:root {
  --ink: #18312c;
  --muted: #64736f;
  --line: #d9e3df;
  --soft-line: #eaf0ed;
  --canvas: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f8fbf9;
  --green: #146c5b;
  --green-dark: #0d5044;
  --green-soft: #dcefe9;
  --blue: #246cae;
  --blue-soft: #e2effa;
  --orange: #b76019;
  --orange-soft: #fcebd9;
  --red: #b53939;
  --red-soft: #f9e2e2;
  --purple: #7854a6;
  --purple-soft: #eee6f8;
  --shadow: 0 12px 36px rgba(27, 55, 47, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1fr);
  background: #f7faf8;
}
.login-art {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 8vw, 108px);
  background: #11594b;
  color: #fff;
}
.login-art::before, .login-art::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.18);
  transform: rotate(-18deg);
}
.login-art::before { width: 620px; height: 620px; border-radius: 50%; right: -240px; top: -120px; }
.login-art::after { width: 430px; height: 430px; border-radius: 50%; left: -240px; bottom: -260px; }
.brand-lockup { position: relative; z-index: 1; max-width: 560px; }
.brand-kicker { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: 0; color: #cce7df; }
.mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.42); font-weight: 700; }
.login-art h1 { margin: 74px 0 18px; font-size: clamp(38px, 4vw, 60px); line-height: 1.16; font-weight: 650; letter-spacing: 0; }
.login-art p { max-width: 430px; margin: 0; color: #d7eee8; font-size: 16px; line-height: 1.8; }
.login-footnote { position: absolute; z-index: 1; bottom: 42px; font-size: 13px; color: #b5d8ce; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(400px, 100%); }
.login-card h2 { margin: 0 0 10px; font-size: 27px; letter-spacing: 0; }
.login-card > p { margin: 0 0 34px; color: var(--muted); font-size: 14px; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 244px; flex: 0 0 244px; min-height: 100vh; background: #153c35; color: #e8f3ef; display: flex; flex-direction: column; padding: 20px 12px; }
.side-brand { padding: 8px 10px 29px; display: flex; align-items: center; gap: 11px; }
.side-brand .mark { border-color: rgba(255,255,255,.45); width: 30px; height: 30px; }
.side-brand strong { display: block; font-size: 16px; font-weight: 650; }
.side-brand span { display: block; color: #aac8bf; font-size: 11px; margin-top: 2px; }
.sidebar nav { display: grid; gap: 3px; }
.nav-item { height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 13px; color: #c5dbd4; background: transparent; border: 0; border-radius: 6px; text-align: left; font-size: 14px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { background: #206a5b; color: #fff; font-weight: 600; }
.nav-glyph { color: #a9d5c9; width: 17px; text-align: center; font-size: 14px; }
.nav-item.active .nav-glyph { color: #d9f4eb; }
.side-bottom { margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid rgba(255,255,255,.11); font-size: 12px; color: #a9c4bc; line-height: 1.7; }

.main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { height: 68px; flex: 0 0 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--ink); margin-left: 7px; font-size: 15px; }
.top-user { display: flex; align-items: center; gap: 13px; }
.user-copy { text-align: right; line-height: 1.25; }
.user-copy strong { display: block; font-size: 13px; }
.user-copy span { font-size: 11px; color: var(--muted); }
.avatar { width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green-dark); font-size: 12px; font-weight: 700; }
.text-button { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 6px; }
.text-button:hover { color: var(--green); }
.content { padding: 28px 32px 48px; max-width: 1600px; width: 100%; margin: 0 auto; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 26px; letter-spacing: 0; line-height: 1.25; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.action-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 6px; padding: 0 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
.button:hover { border-color: #b7c9c3; background: #fbfdfc; }
.button.primary { background: var(--green); color: #fff; border-color: var(--green); }
.button.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.button.danger { color: var(--red); border-color: #efcaca; }
.button.small { min-height: 30px; padding: 0 9px; font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { background: var(--surface); border: 1px solid var(--line); padding: 17px 18px; min-height: 120px; }
.metric-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.metric-mark { font-size: 13px; color: var(--green); font-weight: 800; }
.metric strong { display: block; margin-top: 18px; font-size: 28px; line-height: 1; letter-spacing: 0; }
.metric small { display: block; margin-top: 9px; color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: 18px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); }
.panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 19px; border-bottom: 1px solid var(--soft-line); }
.panel-head h2 { font-size: 15px; margin: 0; letter-spacing: 0; }
.panel-head span { color: var(--muted); font-size: 12px; }
.panel-body { padding: 18px; }
.pipeline-list { display: grid; gap: 14px; }
.pipeline-row { display: grid; grid-template-columns: 105px minmax(40px, 1fr) 110px; align-items: center; gap: 10px; font-size: 13px; }
.pipeline-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.pipeline-bar { height: 8px; background: #edf3f0; overflow: hidden; }
.pipeline-bar > i { height: 100%; display: block; background: var(--green); }
.pipeline-amount { text-align: right; font-weight: 600; color: var(--ink); }
.item-list { display: grid; }
.list-item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--soft-line); }
.list-item:last-child { border-bottom: 0; }
.list-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.list-main strong { display: block; font-size: 13px; font-weight: 600; }
.list-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.list-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 13px; }

.data-panel { background: var(--surface); border: 1px solid var(--line); }
.filters { padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--soft-line); flex-wrap: wrap; }
.input, .select, .textarea { width: 100%; min-height: 37px; border: 1px solid #cfdcd7; border-radius: 5px; padding: 0 10px; outline: 0; background: #fff; color: var(--ink); font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,108,91,.11); }
.filter-search { width: min(280px, 100%); }
.filter-select { width: 130px; }
.textarea { min-height: 86px; padding: 9px 10px; resize: vertical; line-height: 1.5; }
.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; min-width: 800px; }
.data-table th { background: var(--surface-soft); color: var(--muted); height: 38px; padding: 0 16px; text-align: left; font-weight: 500; font-size: 12px; white-space: nowrap; }
.data-table td { height: 56px; padding: 8px 16px; border-top: 1px solid var(--soft-line); font-size: 13px; vertical-align: middle; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fbfdfc; }
.primary-line { font-weight: 600; color: var(--ink); }
.secondary-line { margin-top: 4px; color: var(--muted); font-size: 12px; }
.number { font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green-dark); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.gray { background: #edf1ef; color: #53635e; }

.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 8px; }
.board-column { min-width: 210px; background: #eef3f1; border: 1px solid #dce7e3; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px; font-size: 13px; font-weight: 650; border-bottom: 1px solid #dce7e3; }
.board-count { color: var(--muted); font-size: 12px; font-weight: 500; }
.board-card { margin: 9px; padding: 12px; background: #fff; border: 1px solid #dbe5e1; box-shadow: 0 2px 6px rgba(25,55,47,.04); cursor: pointer; }
.board-card:hover { border-color: #a9c8bf; }
.board-card strong { display: block; font-size: 13px; line-height: 1.45; }
.board-card p { margin: 6px 0 10px; color: var(--muted); font-size: 12px; }
.board-card-foot { display: flex; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 11px; }

.task-list { background: var(--surface); border: 1px solid var(--line); }
.task-row { display: grid; grid-template-columns: 22px minmax(180px, 1fr) 160px 130px 90px; align-items: center; gap: 14px; padding: 13px 17px; border-bottom: 1px solid var(--soft-line); cursor: pointer; }
.task-row:hover { background: #fbfdfc; }
.task-row:last-child { border-bottom: 0; }
.task-check { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.task-subject { font-weight: 600; font-size: 13px; }
.task-detail { margin-top: 4px; color: var(--muted); font-size: 12px; }
.task-customer, .task-owner, .task-due { color: var(--muted); font-size: 12px; }
.task-completed { opacity: .58; }
.task-completed .task-subject { text-decoration: line-through; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(11,34,29,.42); }
.modal { width: min(680px, 100%); max-height: min(830px, calc(100vh - 40px)); overflow: auto; background: #fff; border-radius: 8px; box-shadow: 0 24px 80px rgba(5,30,24,.3); }
.modal.wide { width: min(980px, 100%); }
.modal-head { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 21px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; letter-spacing: 0; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 5px; color: var(--muted); font-size: 19px; line-height: 1; }
.icon-button:hover { background: #edf3f0; color: var(--ink); }
.modal-body { padding: 20px 21px 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 7px; color: #445853; font-size: 12px; font-weight: 600; }
.field label .required { color: var(--red); margin-left: 3px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--soft-line); }

.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--soft-line); border-left: 1px solid var(--soft-line); margin-bottom: 20px; }
.detail-cell { min-height: 77px; padding: 12px; border-right: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); }
.detail-cell span { display: block; color: var(--muted); font-size: 11px; }
.detail-cell strong { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; word-break: break-word; }
.detail-notes { margin-bottom: 20px; padding: 13px; background: var(--surface-soft); color: #53635e; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 9px; font-size: 14px; }
.section-title h3 { margin: 0; font-size: 14px; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th, .mini-table td { text-align: left; padding: 9px 7px; border-bottom: 1px solid var(--soft-line); font-size: 12px; }
.mini-table th { color: var(--muted); font-weight: 500; background: var(--surface-soft); }

.toast { width: min(360px, calc(100vw - 32px)); margin: 11px auto; padding: 12px 15px; border-radius: 6px; color: #fff; background: #1e5d50; box-shadow: 0 8px 24px rgba(19,55,47,.25); font-size: 13px; }
.toast.error { background: #a93333; }
#toast-region { position: fixed; z-index: 50; bottom: 18px; left: 50%; transform: translateX(-50%); pointer-events: none; }

@media (max-width: 1000px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 22px minmax(160px, 1fr) 100px; }
  .task-customer, .task-owner { display: none; }
}
@media (max-width: 760px) {
  .login-page { grid-template-columns: 1fr; }
  .login-art { min-height: 310px; padding: 34px 28px; }
  .login-art h1 { margin-top: 42px; font-size: 37px; }
  .login-footnote { bottom: 25px; }
  .login-panel { padding: 36px 24px 50px; }
  .sidebar { width: 62px; flex-basis: 62px; padding: 16px 8px; }
  .side-brand { padding: 6px 8px 23px; }
  .side-brand strong, .side-brand span, .nav-item > span:not(.nav-glyph), .side-bottom { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-glyph { width: auto; font-size: 16px; }
  .topbar { padding: 0 16px; }
  .breadcrumb { display: none; }
  .topbar { justify-content: flex-end; }
  .content { padding: 22px 16px 38px; }
  .page-heading { margin-bottom: 18px; align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 23px; }
  .metric-grid { gap: 10px; }
  .metric { min-height: 108px; padding: 14px; }
  .metric strong { font-size: 24px; margin-top: 15px; }
  .pipeline-row { grid-template-columns: 90px minmax(35px, 1fr) 85px; font-size: 12px; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-row { grid-template-columns: 22px minmax(110px, 1fr) 82px; padding: 12px; gap: 8px; }
  .task-due { text-align: right; }
}

/* 项目制 CRM 工作台 */
.workflow-shell { min-height: 100vh; background: #f3f7f6; color: #162a33; }
.workflow-top { height: 68px; display: flex; align-items: center; gap: 24px; padding: 0 28px; background: #fff; border-bottom: 1px solid #d9e4e3; }
.workflow-brand { flex: 0 0 190px; color: #16373b; line-height: 1.15; }
.workflow-brand b { display: block; letter-spacing: 3px; font-size: 18px; }
.workflow-brand small { color: #176b5b; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.workflow-crumb { flex: 1; min-width: 0; color: #718187; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workflow-crumb strong { color: #162a33; }
.workflow-user { display: flex; align-items: center; gap: 12px; }
.workflow-user > span { display: grid; text-align: right; line-height: 1.25; }
.workflow-user b { font-size: 13px; }
.workflow-user small { color: #718187; font-size: 11px; }
.role-switch { min-height: 36px; max-width: 190px; border: 1px solid #d9e4e3; background: #fff; border-radius: 7px; padding: 0 9px; color: #162a33; font-size: 12px; }
.icon-command { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #d9e4e3; border-radius: 6px; background: #fff; color: #647477; font-size: 16px; }
.workflow-layout { max-width: 1600px; margin: 0 auto; padding: 18px 22px 42px; display: grid; grid-template-columns: 238px minmax(0, 1fr) 278px; gap: 16px; }
.workflow-side, .workflow-right { min-width: 0; }
.workflow-side { position: sticky; top: 14px; align-self: start; border: 1px solid #e1eae7; background: #fff; border-radius: 8px; box-shadow: 0 5px 16px rgba(20, 55, 50, .05); padding: 12px; }
.side-title { margin: 3px 7px 9px; color: #718187; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.workflow-nav { display: grid; gap: 2px; }
.workflow-nav-item { width: 100%; min-height: 37px; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 6px; background: transparent; color: #33454b; padding: 0 10px; text-align: left; font-size: 13px; }
.workflow-nav-item:hover { background: #f1f7f4; color: #176b5b; }
.workflow-nav-item.active { background: #e8f4ef; color: #14624f; font-weight: 700; }
.workflow-nav-item i { min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: #e4ecea; color: #607073; font-style: normal; font-size: 10px; }
.workflow-nav-item.active i { background: #176b5b; color: #fff; }
.side-rule { margin: 14px 3px 2px; padding: 10px; border-top: 1px solid #edf1f1; color: #647477; font-size: 11px; line-height: 1.7; }
.workflow-main { min-width: 0; }
.workflow-heading { margin: 3px 0 16px; }
.workflow-heading h1 { font-size: 22px; }
.workflow-heading p { max-width: 760px; font-size: 12px; line-height: 1.6; }
.workflow-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 14px 0; }
.workflow-kpi { min-height: 118px; border: 1px solid #dfe8e5; background: #fff; border-radius: 7px; padding: 15px; box-shadow: 0 4px 14px rgba(20, 55, 50, .04); }
.workflow-kpi small, .workflow-kpi span { display: block; color: #718187; font-size: 11px; }
.workflow-kpi b { display: block; margin: 15px 0 8px; color: #16373b; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.rule-banner, .context-strip { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 11px 13px; background: #e8f4ef; border: 1px solid #d2e8df; border-radius: 7px; color: #285c52; font-size: 12px; }
.rule-banner span { background: #fff; border: 1px solid #d9e4e3; border-radius: 5px; padding: 4px 7px; color: #355149; }
.context-strip { justify-content: space-between; margin-bottom: 13px; background: #fff; color: #162a33; }
.context-strip > div { display: grid; gap: 4px; }
.context-strip small { color: #718187; font-size: 11px; }
.surface { border: 1px solid #dfe8e5; background: #fff; border-radius: 7px; box-shadow: 0 4px 14px rgba(20, 55, 50, .04); overflow: hidden; }
.surface-head { min-height: 53px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1f1; }
.surface-head h2 { margin: 0; font-size: 15px; }
.surface-head span { color: #718187; font-size: 12px; }
.surface-head.wrap { flex-wrap: wrap; padding: 10px 15px; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline-filter { display: flex; align-items: center; gap: 7px; }
.input.compact, .select.compact { width: min(310px, 100%); min-height: 34px; }
.workflow-table td small, .workflow-table td > small { display: block; margin-top: 4px; color: #718187; font-size: 11px; line-height: 1.45; }
.workflow-table td { vertical-align: top; height: auto; padding-top: 11px; padding-bottom: 11px; }
.workflow-table tr { cursor: default; }
.workflow-table .actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.table-link { padding: 0; border: 0; background: transparent; color: #176b5b; font-weight: 700; text-align: left; }
.table-link:hover, .text-command:hover { color: #0d5044; text-decoration: underline; }
.text-command { padding: 4px; border: 0; background: transparent; color: #176b5b; font-size: 12px; font-weight: 700; }
.list-row { padding: 12px 15px; border-bottom: 1px solid #edf1f1; display: grid; gap: 4px; cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fbfdfc; }
.list-row b { font-size: 13px; }
.list-row small { color: #718187; font-size: 11px; }
.tabs { display: flex; gap: 7px; margin-bottom: 11px; }
.tabs button { min-height: 33px; padding: 0 11px; border: 1px solid #d9e4e3; border-radius: 6px; background: #fff; color: #647477; font-size: 12px; }
.tabs button.active { border-color: #176b5b; background: #176b5b; color: #fff; font-weight: 700; }
.stage-road { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 13px 0; }
.stage-road.full { grid-template-columns: repeat(4, minmax(150px, 1fr)); overflow-x: auto; }
.stage-road.slim { grid-template-columns: repeat(8, minmax(100px, 1fr)); overflow-x: auto; }
.stage-card { min-height: 96px; display: grid; align-content: start; gap: 7px; border: 1px solid #d9e4e3; background: #fff; border-radius: 7px; padding: 10px; }
.stage-card b { font-size: 12px; }
.stage-card small { color: #718187; font-size: 11px; line-height: 1.5; }
.stage-card.current { border-color: #176b5b; box-shadow: inset 3px 0 #176b5b; background: #fbfefc; }
.stage-card.done { background: #e8f4ef; }
.stage-card.locked { opacity: .62; background: #f6f8f7; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detail-grid > div { min-height: 78px; padding: 12px; border-right: 1px solid #edf1f1; border-bottom: 1px solid #edf1f1; }
.detail-grid > div:nth-child(4n) { border-right: 0; }
.detail-grid small { display: block; color: #718187; font-size: 11px; }
.detail-grid b { display: block; margin-top: 7px; font-size: 13px; line-height: 1.45; }
.detail-grid .span-two { grid-column: span 2; }
.member-grid { display: grid; }
.member-row { display: grid; grid-template-columns: minmax(200px, 1.5fr) minmax(140px, 1fr) minmax(130px, .8fr) auto; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid #edf1f1; }
.member-row:last-child { border-bottom: 0; }
.member-row div { display: grid; gap: 4px; }
.member-row small { color: #718187; font-size: 11px; }
.content-block { padding: 15px; }
.content-block p { color: #52656a; font-size: 13px; line-height: 1.65; }
.warning-note { border-left: 3px solid #a9680c; background: #fff2df; padding: 9px 10px; color: #7e4c08; }
.return-note { border: 1px solid #ebbab4; background: #fffafa; border-radius: 6px; padding: 10px; color: #90362c; font-size: 12px; line-height: 1.6; }
.rail-card { margin-bottom: 12px; border: 1px solid #dfe8e5; background: #fff; border-radius: 7px; padding: 14px; box-shadow: 0 4px 14px rgba(20, 55, 50, .04); }
.rail-card h2 { margin: 0 0 10px; font-size: 14px; }
.rail-card b { display: block; font-size: 13px; }
.rail-card small { display: block; margin-top: 5px; color: #718187; font-size: 11px; line-height: 1.55; }
.modal-head p { margin: 3px 0 0; color: #718187; font-size: 11px; }
.field > span { display: block; margin-bottom: 6px; color: #445853; font-size: 12px; font-weight: 650; }
.field > span i { color: #b44234; font-style: normal; }
.check-field { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; }
.check-field input { width: 17px; height: 17px; accent-color: #176b5b; }
.file-field { border: 1px dashed #9ab5ae; background: #f9fcfb; border-radius: 6px; padding: 10px; }
.file-field input { max-width: 100%; font-size: 12px; }
.file-field small { display: block; margin-top: 6px; color: #176b5b; font-size: 11px; }
.stage-checks { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-checks label { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border: 1px solid #d9e4e3; border-radius: 5px; color: #52656a; font-size: 11px; }
.modal-section { margin-top: 18px; }
.modal-section h3 { margin: 0 0 8px; font-size: 14px; }
.detail-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border: 1px solid #edf1f1; }
.detail-toolbar .detail-grid { flex: 1; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-head h3 { margin: 0; }
.relationship-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 12px; border-top: 1px solid #edf1f1; }
.relationship-row > div:first-child { display: grid; gap: 4px; min-width: 0; }
.relationship-row b { font-size: 13px; }
.relationship-row small { color: #718187; font-size: 11px; line-height: 1.45; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.text-command.danger { color: #a93333; }
.chain-block { border-top: 1px solid #dfe8e5; }
.chain-members { margin: 0 12px 12px; border-left: 2px solid #d8e9e4; }
.chain-member { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 48px; padding: 8px 9px; border-bottom: 1px solid #edf1f1; }
.chain-member > span { width: 22px; height: 22px; display: grid; place-items: center; background: #e8f4ef; color: #176b5b; font-size: 10px; font-weight: 700; }
.chain-member div { display: grid; gap: 3px; min-width: 0; }
.chain-member b { font-size: 12px; }
.chain-member small { color: #718187; font-size: 11px; }
.json-view { padding: 10px; background: #f5f8f7; border: 1px solid #e4ece9; border-radius: 5px; white-space: pre-wrap; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-note { margin: 16px 0 0; color: #718187; font-size: 12px; line-height: 1.6; }

@media (max-width: 1220px) {
  .workflow-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .workflow-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .rail-card { margin: 0; }
}
@media (max-width: 900px) {
  .workflow-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-row { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid > div:nth-child(4n) { border-right: 1px solid #edf1f1; }
  .detail-grid > div:nth-child(2n) { border-right: 0; }
}
@media (max-width: 720px) {
  .workflow-top { height: auto; min-height: 62px; padding: 11px 14px; flex-wrap: wrap; gap: 9px; }
  .workflow-brand { flex: 1; }
  .workflow-crumb { order: 3; flex-basis: 100%; }
  .workflow-user > span { display: none; }
  .workflow-layout { display: block; padding: 10px; }
  .workflow-side { position: static; margin-bottom: 10px; padding: 8px; }
  .workflow-nav { display: flex; overflow-x: auto; }
  .workflow-nav-item { width: auto; min-width: max-content; }
  .workflow-side .side-title, .side-rule { display: none; }
  .workflow-right { display: none; }
  .workflow-heading { align-items: flex-start; flex-direction: column; }
  .two-columns { grid-template-columns: 1fr; }
  .stage-road { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-kpis { gap: 8px; }
  .workflow-kpi { min-height: 104px; padding: 12px; }
  .workflow-kpi b { font-size: 23px; }
  .member-row { grid-template-columns: 1fr; }
  .detail-grid .span-two { grid-column: auto; }
  .detail-toolbar { display: grid; }
  .relationship-row { align-items: flex-start; flex-direction: column; }
  .row-actions { justify-content: flex-start; }
  .chain-member { grid-template-columns: 24px minmax(0, 1fr); }
  .chain-member .text-command { grid-column: 2; justify-self: start; }
  .role-switch { max-width: 155px; }
}
