/* v5 / calm, task-first operations. Geometry and typography carry hierarchy. */
:root {
  --bg: #f6f7f9;
  --panel: #fff;
  --ink: #202937;
  --muted: #687384;
  --line: #e5e9ed;
  --brand: #26675c;
  --radius: 12px;
}
body {
  background: var(--bg);
  letter-spacing: 0;
  font-size: 14px;
}
#sidebar {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: none;
  padding: 27px 15px 20px;
}
main {
  margin-left: 220px;
}
.brand {
  padding: 0 11px 22px;
  letter-spacing: -0.6px;
}
.brand-mark {
  background: #244b43;
  box-shadow: none;
  border-radius: 10px;
}
.brand small {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: var(--muted);
}
.workspace {
  margin: 0 5px 25px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 9px;
}
.workspace-emblem {
  display: none;
}
.workspace div {
  font-size: 12px;
}
.workspace small {
  font-size: 10px;
}
#navigation {
  padding: 0;
  gap: 4px;
  display: flex;
  flex-direction: column;
}
#navigation a {
  border-radius: 8px;
  min-height: 43px;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
  margin: 0;
  gap: 12px;
  border: 0;
  background: none;
}
#navigation a .glyph {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}
#navigation a:hover {
  background: var(--bg);
  color: var(--ink);
}
#navigation a.active {
  background: #e9f1ee;
  color: #245a4e;
  font-weight: 650;
  box-shadow: none;
}
#navigation a.active:before {
  display: none;
}
#navigation a.secondary-nav {
  font-size: 12px;
  min-height: 38px;
}
#navigation a:nth-child(8) {
  margin-top: 33px;
}
.nav-dot {
  width: 5px;
  height: 5px;
  background: #b88b39;
  border-radius: 50%;
  margin-left: auto;
}
.side-footer {
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
  padding: 16px 10px 0;
}
.side-footer small {
  font-size: 10px;
  letter-spacing: 0.3px;
}
main > header {
  height: 72px;
  background: var(--panel);
  padding: 0 32px;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
#breadcrumb {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.mode-tag {
  display: none;
}
.command-trigger {
  background: var(--bg);
  box-shadow: none;
  border-color: var(--line);
}
#content {
  max-width: 1400px;
  padding: 32px 36px 48px;
}
.page-head {
  margin-bottom: 25px;
  align-items: center;
}
.page-head h1 {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.7px;
}
.page-head p {
  font-size: 13px;
  margin-top: 8px;
  color: var(--muted);
}
#connectionBanner:not(:empty) {
  background: #f8f4e9;
  color: #79653a;
  border: 0;
  border-bottom: 1px solid #e9e0c9;
  font-size: 11px;
  padding: 9px 32px;
  margin: 0;
  border-radius: 0;
}
.button {
  border-radius: 8px;
  min-height: 37px;
  font-weight: 550;
  box-shadow: none !important;
  padding: 8px 14px;
  font-size: 12px;
}
.button.primary {
  background: #285f54;
  border-color: #285f54;
  color: white;
}
.button.danger {
  color: #a34e43;
  border-color: #e8d5d0;
  background: transparent;
}
.button.small {
  padding: 5px 10px;
  font-size: 11px;
}
.button:hover {
  transform: none;
  filter: brightness(0.97);
}
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #9cbeb3;
  outline-offset: 3px;
}
.glyph {
  flex-shrink: 0;
}
.context-nav {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin: -9px 0 27px;
  overflow: auto;
  scrollbar-width: thin;
}
.context-nav a {
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  padding: 0 1px 15px;
  border-bottom: 2px solid transparent;
}
.context-nav a.active {
  color: #285f54;
  border-color: #285f54;
  font-weight: 650;
}
.balance-overview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  padding: 28px 30px;
  margin: 0 0 18px;
}
.balance-main > strong {
  display: block;
  font-size: 39px;
  font-weight: 550;
  letter-spacing: -1.7px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  margin-top: 5px;
}
.balance-main p {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 19px;
}
.balance-main p span {
  margin: 0 8px;
}
.balance-main .micro-label {
  font-size: 11px !important;
  letter-spacing: 0.3px;
}
.balance-side {
  padding: 10px 0 0 30px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-self: center;
  min-height: 108px;
  gap: 10px;
}
.balance-side > span {
  font-size: 12px;
  color: var(--muted);
}
.balance-side strong {
  font-size: 22px;
  font-weight: 550;
  letter-spacing: -0.6px;
}
.balance-side small,
.balance-side a {
  font-size: 11px;
  color: var(--muted);
}
.balance-side a:hover {
  color: var(--brand);
}
.quick-lanes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 27px;
}
.quick-lanes a {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--panel);
  padding: 17px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.quick-lanes a:hover {
  border-color: #9eafa9;
}
.quick-lanes a > .glyph:first-child {
  width: 23px;
  height: 23px;
  color: #52746b;
}
.quick-lanes a > .glyph:last-child {
  margin-left: auto;
  width: 15px;
  color: #84918e;
}
.quick-lanes b {
  font-size: 13px;
  font-weight: 600;
}
.quick-lanes small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr);
  gap: 20px;
}
.work-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.section-heading {
  padding: 20px 23px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.section-heading h2 {
  font-size: 14px;
  font-weight: 650;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.text-tag {
  font-size: 10px;
  color: var(--muted);
}
.count-pill {
  font-size: 10px;
  background: var(--bg);
  color: var(--muted);
  border-radius: 5px;
  min-width: 21px;
  text-align: center;
  padding: 3px;
}
.calm-empty {
  min-height: 220px;
  padding: 30px 26px 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.calm-empty > .glyph {
  width: 29px;
  height: 29px;
  color: #91a69e;
  margin: 5px;
}
.calm-empty h3 {
  font-size: 14px;
  font-weight: 550;
  margin: 14px 0 8px;
}
.calm-empty p {
  font-size: 12px;
  line-height: 1.8;
  max-width: 330px;
  margin: 0;
  color: var(--muted);
}
.readiness {
  padding: 0 23px;
}
.readiness > div {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.readiness > div:last-child {
  border: 0;
}
.readiness b {
  font-size: 12px;
  font-weight: 550;
}
.readiness small {
  display: block;
  font-size: 10px;
  margin-top: 3px;
  color: var(--muted);
}
.readiness > div > span:last-child {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}
.readiness-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c5cbd2;
  flex-shrink: 0;
}
.readiness-dot.done {
  background: #528b71;
}
.quiet-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  padding: 12px 23px 19px;
  margin: 0;
}
.recent-panel {
  margin-top: 20px;
}
.queue-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 23px;
  border-top: 1px solid var(--line);
}
.queue-row > div {
  flex: 1;
  min-width: 0;
}
.queue-row b {
  font-size: 12px;
  font-weight: 550;
  display: block;
  overflow-wrap: anywhere;
}
.queue-row small {
  display: block;
  font-size: 10px;
  margin-top: 5px;
  color: var(--muted);
}
.queue-kind {
  font-size: 10px;
  color: var(--muted);
  width: 57px;
  flex-shrink: 0;
}
.queue-row strong {
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.queue-more {
  font-size: 11px;
  padding: 5px 23px;
}
.panel,
.product,
.stat-strip,
.product-refined {
  border-color: var(--line);
  box-shadow: none;
  border-radius: 12px;
}
.stat-strip {
  margin-bottom: 22px;
}
.metric strong {
  font-size: 25px;
  font-weight: 550;
}
.metric-label,
.metric small {
  font-size: 11px !important;
}
.filters {
  gap: 9px;
}
.filters input,
.filters select {
  font-size: 12px;
  border-radius: 7px;
  background: var(--panel);
  border-color: var(--line);
}
table th {
  background: var(--bg);
  font-size: 11px;
  font-weight: 550;
  color: var(--muted);
  padding: 12px 15px;
}
table td {
  font-size: 12px;
  padding: 16px 15px;
  border-color: var(--line);
}
table td small {
  font-size: 10px !important;
}
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.table-footer {
  font-size: 11px;
}
.badge {
  border-radius: 5px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.badge.ok {
  background: #edf5ef;
  color: #3e785b;
}
.badge.warn {
  background: #f6f1e5;
  color: #8e763c;
}
.badge.bad {
  background: #f7eeeb;
  color: #a2594b;
}
.inventory-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  flex-wrap: wrap;
}
.inventory-toolbar > span {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
}
input[type="checkbox"] {
  accent-color: #285f54;
  width: 16px;
  height: 16px;
}
.case-timeline {
  margin: 24px 0;
  border-left: 1px solid var(--line);
  padding-left: 19px;
}
.case-timeline > div {
  position: relative;
  margin-bottom: 21px;
}
.case-timeline > div:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9bb0a6;
  position: absolute;
  left: -23px;
  top: 6px;
}
.case-timeline small {
  font-size: 11px;
  color: var(--muted);
}
.case-timeline p {
  color: var(--ink);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
}
.order-aftersales {
  border-top: 1px solid var(--line);
  margin-top: 25px;
  padding-top: 15px;
}
.order-aftersales h3 {
  font-size: 14px;
}
.order-aftersales .actions {
  margin: 15px 0;
}
.product-visual {
  filter: saturate(0.55);
  min-height: 125px;
}
.product-body {
  padding: 22px;
}
.product-facts strong {
  font-size: 23px;
}
.section-intro {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}
.product-refined {
  overflow: hidden;
}
.tabs a.active {
  color: #285f54;
  border-color: #285f54;
}
.tabs {
  gap: 8px;
  flex-wrap: wrap;
}
.member-hero,
.agent-hero {
  box-shadow: none;
  filter: saturate(0.65);
}
footer {
  font-size: 10px;
  color: var(--muted);
  border-top: 0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 80px #12211b24;
}
.dialog-head {
  background: var(--panel);
}
.dialog-head h2 {
  font-size: 18px;
}
.field label {
  font-size: 12px;
}
.field input,
.field select,
.field textarea {
  border-radius: 8px;
  font-size: 13px;
}
.notice {
  font-size: 12px;
}
body.dark {
  --bg: #141c23;
  --panel: #1b252e;
  --ink: #e1e8ed;
  --muted: #9aa8b5;
  --line: #303d47;
  --brand: #8fbcab;
  background: var(--bg);
  color: var(--ink);
}
body.dark #sidebar,
body.dark main > header,
body.dark .work-panel,
body.dark .balance-overview,
body.dark .quick-lanes a {
  background: var(--panel);
  border-color: var(--line);
}
body.dark #navigation a.active {
  background: #294239;
  color: #b6d8c6;
}
body.dark .context-nav a.active {
  color: #b6d8c6;
  border-color: #96bfae;
}
body.dark .button.primary {
  background: #4d7f6c;
  border-color: #4d7f6c;
}
body.dark #connectionBanner:not(:empty) {
  background: #302e24;
  color: #d4c39b;
  border-color: #4a4431;
}
body.dark .badge.ok {
  background: #2a4036;
  color: #a8d1b6;
}
body.dark .badge.warn {
  background: #403b2c;
  color: #dac798;
}
body.dark .badge.bad {
  background: #452f2c;
  color: #dfa89e;
}
body.dark .tabs a.active {
  color: #a8d1b6;
  border-color: #a8d1b6;
}
body.dark table th {
  background: var(--bg);
}
body.dark .button.danger {
  color: #dfa89e;
  border-color: #66463e;
}
body.dark .dialog-head,
body.dark .workspace {
  background: var(--panel);
}
@media (min-width: 1500px) {
  #content {
    padding-top: 37px;
  }
  .balance-overview {
    padding: 34px;
  }
  .balance-main > strong {
    font-size: 43px;
  }
}
@media (max-width: 1100px) {
  #content {
    padding: 25px;
  }
  .quick-lanes {
    grid-template-columns: repeat(2, 1fr);
  }
  .balance-overview {
    grid-template-columns: 1.5fr 1fr;
  }
  .balance-side:last-child {
    display: none;
  }
  .work-grid {
    grid-template-columns: 1fr;
  }
  .readiness {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 25px;
  }
  .readiness > div:nth-last-child(2) {
    border: 0;
  }
  .queue-row {
    padding: 14px 20px;
  }
}
@media (max-width: 760px) {
  #sidebar {
    width: 235px;
  }
  main {
    margin-left: 0;
  }
  main > header {
    padding: 0 16px;
    height: 62px;
  }
  #content {
    padding: 22px 16px 35px;
  }
  #connectionBanner:not(:empty) {
    padding: 8px 16px;
    font-size: 10px;
    line-height: 1.7;
  }
  .page-head {
    align-items: flex-start;
    gap: 13px;
  }
  .page-head h1 {
    font-size: 23px;
  }
  .page-head p {
    font-size: 12px;
  }
  .page-head .actions {
    flex-wrap: wrap;
  }
  .page-head .actions .button {
    padding: 7px 10px;
    font-size: 11px;
  }
  .balance-overview {
    padding: 23px;
    grid-template-columns: 1fr;
  }
  .balance-main > strong {
    font-size: 35px;
  }
  .balance-side {
    display: none;
  }
  .quick-lanes {
    gap: 9px;
    margin-bottom: 18px;
  }
  .quick-lanes a {
    padding: 14px 11px;
    gap: 9px;
  }
  .quick-lanes a > .glyph:last-child {
    display: none;
  }
  .quick-lanes small {
    font-size: 9px;
  }
  .quick-lanes b {
    font-size: 12px;
  }
  .section-heading {
    padding: 18px;
  }
  .queue-kind {
    display: none;
  }
  .queue-row {
    padding: 14px 18px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .queue-row > div {
    min-width: 125px;
  }
  .readiness {
    padding: 0 18px;
    grid-template-columns: 1fr;
  }
  .readiness > div:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }
  .context-nav {
    gap: 20px;
    margin-top: 0;
  }
  .context-nav a {
    font-size: 12px;
    padding-bottom: 12px;
  }
  .inventory-toolbar > span {
    width: 100%;
    margin-bottom: 5px;
  }
  .inventory-toolbar .button {
    font-size: 11px;
    padding: 7px 9px;
  }
  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .filters .grow {
    grid-column: 1/-1;
  }
  table td {
    padding: 13px 12px;
  }
  .calm-empty {
    min-height: 205px;
  }
  .table-wrap {
    overflow: auto;
  }
  .record-ref {
    max-width: 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
#sidebar,
.brand,
.workspace {
  color: var(--ink);
}
.brand-light {
  color: var(--muted);
}
.brand-mark {
  color: #e4f0ea;
}
.workspace small {
  color: var(--muted);
}
#navigation a.active .glyph {
  color: inherit;
}
#navigation a.active:after {
  display: none;
}
.pulse {
  background: #6f9c89;
}
.context-nav a,
.context-nav a.active {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}
.context-nav a.active::after {
  display: none;
}
.context-nav a:hover {
  background: transparent;
  color: var(--brand);
}
@media (max-width: 760px) {
  .filters input[type="date"] {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 39px;
    padding: 9px;
  }
  .filters #tableStatus {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }
  .filters #tableFrom {
    grid-column: 1;
    grid-row: 3;
  }
  .filters #tableTo {
    grid-column: 2;
    grid-row: 3;
  }
  .filters > .button {
    grid-column: 2;
    grid-row: 2;
  }
  .table-wrap::before {
    content: "左右滑动查看完整记录";
    display: block;
    position: sticky;
    left: 0;
    padding: 9px 12px;
    font-size: 10px;
    color: var(--muted);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }
}
.context-nav a,
.context-nav a.active {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 1px 15px;
}
.context-nav a.active {
  border-bottom-color: #285f54;
}
body.dark .context-nav a.active {
  border-bottom-color: #96bfae;
}
