/* Admin UI */
:root {
  --ink: #101828; --ink-2: #344054; --muted: #667085; --line: #e4e7ec; --line-2: #eef1f5;
  --soft: #f7f8fa; --brand: #ff5a1f; --brand-d: #e64a10; --ok: #12b76a; --danger: #d92d20;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
body.adm { margin: 0; font-family: var(--font); background: #f4f5f7; color: var(--ink); font-size: 14px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }
table { border-collapse: collapse; width: 100%; }

.adm-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* sidebar ---------------------------------------------------------------- */
.adm-side { background: var(--ink); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.adm-brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.adm-logo { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,90,31,.16); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.adm-brand strong { display: block; font-size: 14.5px; font-weight: 700; }
.adm-brand small { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #8592a6; }
.adm-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.adm-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; font-size: 13.6px; color: #b7c2d3; }
.adm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.adm-nav a.on { background: rgba(255,90,31,.16); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.adm-nav svg { opacity: .85; flex: 0 0 auto; }
.adm-side-foot { padding: 14px 18px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.adm-side-foot a { color: #b7c2d3; }
.adm-side-foot button { background: none; border: 0; padding: 0; color: #8592a6; cursor: pointer; text-align: left; font-size: 13px; }
.adm-side-foot a:hover, .adm-side-foot button:hover { color: #fff; }

/* main ------------------------------------------------------------------- */
.adm-main { padding: 22px 28px 60px; min-width: 0; }
.adm-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.adm-top h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.adm-top-right { display: flex; align-items: center; gap: 12px; }
.adm-user { font-size: 12.5px; color: var(--muted); }

.adm-flash { background: #ecfdf3; border: 1px solid #abefc6; color: #067647; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13.4px; }
.adm-flash.err { background: #fef3f2; border-color: #fecdca; color: #b42318; }

.adm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 15px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 13.4px; font-weight: 600;
  cursor: pointer; color: var(--ink-2); font-family: inherit; white-space: nowrap;
}
.adm-btn:hover { border-color: #cfd6e0; background: var(--soft); }
.adm-btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.adm-btn-primary:hover { background: #1d2a42; border-color: #1d2a42; }
.adm-btn-ghost { background: #fff; }
.adm-btn-block { width: 100%; }
.adm-btn-lg { height: 44px; font-size: 14px; }
.adm-flex1 { flex: 1; }

/* cards ------------------------------------------------------------------ */
.adm-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; overflow: hidden; }
.adm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.adm-card-head h2 { font-size: 15px; font-weight: 700; }
.adm-hint { font-size: 11.8px; color: var(--muted); }
.adm-dim { color: var(--muted); }
.adm-empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.adm-footnote { font-size: 12.3px; margin-top: 6px; }

/* stats ------------------------------------------------------------------ */
.adm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.adm-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.adm-stat span { font-size: 12.3px; color: var(--muted); }
.adm-stat b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.adm-stat b.hot { color: var(--brand); }
.adm-stat a { font-size: 12.3px; color: var(--ink-2); margin-top: 4px; }
.adm-stat a:hover { color: var(--brand); }
.adm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* lists / tables --------------------------------------------------------- */
.adm-list { list-style: none; margin: 0; padding: 6px 0; }
.adm-list li { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-size: 13.4px; border-bottom: 1px solid var(--line-2); }
.adm-list li:last-child { border-bottom: 0; }
.adm-list li a { font-weight: 600; }
.adm-list li a:hover { color: var(--brand); }
.adm-list .adm-mini { margin-left: auto; }

.adm-table th, .adm-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); text-align: left; font-size: 13.3px; vertical-align: middle; }
.adm-table th { background: var(--soft); font-size: 11.6px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.adm-table tbody tr:hover { background: #fcfcfd; }
.adm-table-prod td { vertical-align: middle; }
.adm-prod-name { font-weight: 600; display: block; }
.adm-prod-name:hover { color: var(--brand); }
.adm-table-prod small { display: block; font-size: 11.4px; }
.adm-child { padding-left: 18px; position: relative; }
.adm-child::before { content: "└"; position: absolute; left: 2px; color: #b9c0cc; }
.adm-parent { font-weight: 700; }

.adm-thumb { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: #fef3f2; color: #b42318; font-size: 11px; font-weight: 700; border: 1px dashed #fda29b; }
.adm-thumb.has { background: #ecfdf3; color: #067647; border-color: #abefc6; }

.adm-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--soft); color: var(--muted); }
.adm-badge.ok { background: #ecfdf3; color: #067647; }
.adm-badge.hot { background: #fff2ec; color: var(--brand-d); }
.adm-badge.star { background: #fffaeb; color: #b54708; }

.adm-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-mini { background: none; border: 0; padding: 0; font-size: 12.6px; color: var(--ink-2); cursor: pointer; font-family: inherit; }
.adm-mini:hover { color: var(--brand); text-decoration: underline; }
.adm-mini.danger { color: var(--danger); }

/* toolbar ---------------------------------------------------------------- */
.adm-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.adm-toolbar input[type=search] { max-width: 300px; }
.adm-toolbar select { width: auto; }

/* forms ------------------------------------------------------------------ */
.adm-form2 { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.adm-form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.adm-back { font-size: 13px; color: var(--muted); }
.adm-back:hover { color: var(--ink); }
.adm-fields { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > span { font-size: 12.2px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  font-family: inherit; font-size: 13.6px; color: var(--ink); width: 100%;
  border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; outline: none;
  transition: border-color .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
textarea { resize: vertical; line-height: 1.55; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-check { display: flex; align-items: center; gap: 8px; font-size: 13.2px; cursor: pointer; color: var(--ink-2); }
.adm-check input { width: 15px; height: 15px; accent-color: var(--brand); margin: 0; }
.adm-check.sm { font-size: 12.4px; }

.adm-rows { padding: 14px 20px 6px; display: flex; flex-direction: column; gap: 8px; }
.adm-row4 { display: grid; grid-template-columns: 1fr 1fr 1.3fr 1.3fr 28px; gap: 8px; align-items: center; }
.adm-row3 { display: grid; grid-template-columns: 1fr 1fr 70px 28px; gap: 8px; align-items: center; }
.adm-unit { font-size: 12px; color: var(--muted); }
.adm-row-x { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.adm-row-x:hover { border-color: #fda29b; color: var(--danger); }
.adm-card > .adm-btn { margin: 0 20px 18px; }

/* images ----------------------------------------------------------------- */
.adm-upload { padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.adm-upload form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.adm-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 18px 20px 22px; }
.adm-img { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--soft); }
.adm-img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.adm-img-main { position: absolute; top: 8px; left: 8px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.adm-img-actions { display: flex; gap: 8px; padding: 7px 9px; background: #fff; border-top: 1px solid var(--line-2); flex-wrap: wrap; }

/* attributes ------------------------------------------------------------- */
.adm-attrs { padding: 6px 20px 14px; }
.adm-attr-group { border-bottom: 1px solid var(--line-2); padding: 12px 0; }
.adm-attr-group:last-child { border-bottom: 0; }
.adm-attr-group h4 { font-size: 12.4px; color: var(--muted); letter-spacing: .04em; margin-bottom: 8px; text-transform: uppercase; }
.adm-attr-vals { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.adm-attr-save { padding: 0 20px 18px; }
.adm-attrs-page .adm-card { margin-bottom: 14px; }
.adm-table-tight td { padding: 7px 14px; }
.adm-inline-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-inline-edit input[type=text] { max-width: 220px; }
.adm-inline-add input[type=text]:first-of-type { max-width: 280px; }
.adm-details { border-top: 1px solid var(--line-2); padding: 10px 20px 16px; }
.adm-details summary { cursor: pointer; font-size: 12.6px; color: var(--muted); margin-bottom: 10px; }
.adm-tips { margin: 0; padding: 14px 20px 20px 34px; font-size: 12.8px; color: var(--muted); display: grid; gap: 8px; }

/* inquiries -------------------------------------------------------------- */
.adm-inq-head { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.adm-inq-head h2 { font-size: 15px; }
.adm-inq-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.4px; color: var(--muted); margin-top: 4px; }
.adm-inq-meta a { color: var(--ink-2); text-decoration: underline; }
.adm-inq-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adm-inq-right select { width: auto; font-size: 12.4px; padding: 6px 8px; }
.adm-inq-body { padding: 15px 20px 20px; }
.adm-inq-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.adm-inq-facts span { display: block; font-size: 11.2px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.adm-inq-facts b { font-size: 13.4px; }
.adm-inq-msg { background: var(--soft); border-radius: 9px; padding: 12px 14px; font-size: 13px; white-space: pre-wrap; font-family: inherit; margin: 0 0 12px; color: var(--ink-2); }

/* login ------------------------------------------------------------------ */
body.adm-login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(140deg, #0b1220 0%, #17233a 55%, #2a1a12 100%); }
.adm-login { width: min(420px, 92vw); background: #fff; border-radius: 18px; padding: 30px 28px 24px; box-shadow: 0 30px 60px -25px rgba(0,0,0,.5); }
.adm-login-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.adm-login-brand .adm-logo { background: #fff2ec; border: 1px solid #ffd9c8; }
.adm-login-brand strong { display: block; font-size: 14px; }
.adm-login-brand small { font-size: 10.5px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.adm-login h1 { font-size: 20px; margin-bottom: 14px; }
.adm-login-form { display: flex; flex-direction: column; gap: 12px; }
.adm-login-form .adm-btn { margin-top: 6px; }
.adm-login-back { display: block; text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 1080px) {
  .adm-shell { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .adm-brand { border-bottom: 0; border-right: 1px solid rgba(255,255,255,.08); }
  .adm-nav { flex-direction: row; padding: 8px; }
  .adm-nav a { white-space: nowrap; }
  .adm-side-foot { margin-left: auto; border-top: 0; flex-direction: row; align-items: center; padding: 12px 16px; }
  .adm-form2 { grid-template-columns: 1fr; }
  .adm-stats { grid-template-columns: repeat(2, 1fr); }
  .adm-cols { grid-template-columns: 1fr; }
  .adm-main { padding: 18px; }
}
@media (max-width: 720px) {
  .adm-row4 { grid-template-columns: 1fr 1fr 28px; }
  .adm-row4 input:nth-child(3) { grid-column: 1 / 2; }
  .adm-row4 input:nth-child(4) { grid-column: 2 / 3; }
  .row2 { grid-template-columns: 1fr; }
  .adm-table { font-size: 12.5px; }
  .adm-table th:nth-child(n+4), .adm-table td:nth-child(n+4) { display: none; }
}

/* attribute editor tweaks -------------------------------------------------- */
.adm-table-tight td { white-space: nowrap; }
.adm-table-tight td:last-child { width: 84px; }
.adm-table-tight td .adm-mini { white-space: nowrap; }
.adm-inline-edit input[type=text] { min-width: 140px; }
.adm-inline-edit .adm-mini, .adm-inline-edit .adm-btn { white-space: nowrap; }

/* ==========================================================================
   Orders / chain / files / feedback
   ========================================================================== */
.adm-stats-5 { grid-template-columns: repeat(5, 1fr); }
.adm-stats-2 { grid-template-columns: repeat(2, 1fr); }

.adm-order-head {
  display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 18px;
}
.ao-no { font-size: 19px; display: flex; align-items: center; gap: 10px; }
.ao-money { display: flex; gap: 22px; }
.ao-money div { text-align: right; }
.ao-money span { display: block; font-size: 11.4px; color: var(--muted); }
.ao-money b { font-size: 17px; }
.ao-money b.hot { color: var(--brand); }

/* chain ------------------------------------------------------------------ */
.adm-chain { padding: 14px 20px 4px; }
.adm-chain-bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-bottom: 14px; }
.adm-chain-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #ff9166); border-radius: 999px; }
.adm-chain ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.adm-step { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 7px 0; }
.adm-step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
  background: var(--soft); color: var(--muted); border: 1.5px solid var(--line); font-weight: 700;
}
.adm-step.is-done .adm-step-dot { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.adm-step.is-active .adm-step-dot { background: #fff2ec; border-color: var(--brand); color: var(--brand-d); }
.adm-step.is-failed .adm-step-dot { background: #fef3f2; border-color: #fda29b; color: #b42318; }
.adm-step-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-step-line b { font-size: 13.2px; }
.adm-step-line span { font-size: 11.6px; }
.adm-step.is-pending .adm-step-line b { color: var(--muted); font-weight: 500; }
.adm-step-note { font-size: 12.2px; color: var(--ink-2); background: var(--soft); display: inline-block; padding: 2px 8px; border-radius: 6px; margin-top: 3px; }
.adm-step-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.adm-ev img { width: 54px; height: 54px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }

.adm-step-form { border-top: 1px solid var(--line-2); padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 10px; background: #fcfcfd; }
.adm-step-form-row { display: grid; grid-template-columns: 1.4fr .9fr .8fr; gap: 10px; }
.adm-step-form input[type=file] { background: #fff; }

/* quote row -------------------------------------------------------------- */
.adm-quote-row { display: flex; gap: 12px; align-items: flex-end; padding: 14px 20px 18px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.adm-quote-row .fld { margin: 0; }
.adm-quote-row .fld.grow { flex: 1; min-width: 220px; }

/* files ------------------------------------------------------------------ */
.adm-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 16px 20px 20px; }
.adm-file { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.adm-file:hover { border-color: #ffc3ab; }
.adm-file img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; }
.adm-file-ic {
  width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: var(--soft);
  border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em;
}
.adm-file-name { font-size: 12px; line-height: 1.35; word-break: break-all; }
.adm-file small { font-size: 10.8px; }

/* timeline --------------------------------------------------------------- */
.adm-timeline { list-style: none; margin: 0; padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.adm-timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; font-size: 12.6px; }
.adm-tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: 6px; }
.adm-timeline li:first-child .adm-tl-dot { background: var(--brand); }
.adm-timeline small { display: block; font-size: 11.2px; margin-top: 2px; }

.adm-pay-form { border-top: 1px solid var(--line-2); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.adm-csat { font-size: 14px; color: #f59e0b; letter-spacing: 2px; }
.adm-csat b { color: var(--ink); letter-spacing: 0; font-size: 13px; margin-left: 6px; }

@media (max-width: 1080px) {
  .adm-stats-5 { grid-template-columns: repeat(3, 1fr); }
  .adm-step-form-row { grid-template-columns: 1fr; }
  .adm-order-head { align-items: flex-start; }
}
@media (max-width: 720px) {
  .adm-stats-5 { grid-template-columns: repeat(2, 1fr); }
}

/* pipeline todo + presets */
.adm-todo { border-left: 3px solid var(--brand); }
.adm-todo-body { padding: 16px 20px 18px; }
.adm-todo-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.adm-todo-2col .adm-fields { padding: 0; }
.adm-inline-form { padding: 14px 20px 18px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.adm-inline-form .row2 { gap: 10px; }
@media (max-width: 980px) { .adm-todo-2col { grid-template-columns: 1fr; } }

/* id lifecycle card -------------------------------------------------------- */
.adm-idcard { margin-bottom: 16px; }
.adm-idgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.adm-idgrid > div { background: #fff; padding: 12px 18px; }
.adm-idgrid span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.adm-idgrid b { font-size: 13.4px; }
.adm-keep { color: #067647; }
.adm-exp { color: #b42318; }
.adm-soon { color: #b54708; }
.adm-idact { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 18px 14px; }
.adm-idact form { margin: 0; }
.adm-idact .adm-dim { font-size: 11.6px; line-height: 1.5; flex: 1; min-width: 240px; }
.adm-table small.adm-exp, .adm-table small.adm-soon { display: block; font-size: 10.8px; margin-top: 2px; }
@media (max-width: 1080px) { .adm-idgrid { grid-template-columns: repeat(2, 1fr); } }

/* admin-side helpers used by the shared metro partial */
.btn, .btn-primary, .btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-family: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--brand-d); }
.btn-line:hover { border-color: var(--brand); color: var(--brand-d); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill-ok { background: #ecfdf3; color: #067647; } .pill-warn { background: #fffaeb; color: #b54708; }
.pill-bad { background: #fef3f2; color: #b42318; } .pill-muted { background: var(--soft); color: var(--muted); }
.adm-nav-n { margin-left: auto; min-width: 18px; height: 18px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 5px; }
.adm-page-head { margin-bottom: 16px; } .adm-page-head h1 { font-size: 20px; } .adm-page-head p { margin-top: 4px; font-size: 13px; }
.adm-msgcard { margin-bottom: 12px; }
.adm-msgbody { padding: 0 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.adm-msgmeta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.adm-msgtext { font-size: 13.4px; margin: 0; white-space: pre-wrap; background: #fcfcfd; border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; }
.adm-inline-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.adm-inline-form textarea { width: 100%; font-family: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.adm-inline-form .row2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }

/* ==========================================================================
   Metro map — 跟单线路图 + 站台面板（客户与后台共用同一套类名）
   ========================================================================== */
.metro-wrap {
  border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, #fff, #fcfcfd);
  padding: 16px 16px 6px; margin-bottom: 18px;
}
.metro-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.metro-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.lg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.lg-done { background: #12b76a; }
.lg-cur { background: var(--brand); }
.lg-pending { background: #d0d5dd; }
.lg-fail { background: #d92d20; }
.metro-progress { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.metro-progress b { font-size: 17px; color: var(--ink); }
.metro-open { background: #fffaeb; color: #b54708; border-radius: 999px; padding: 2px 9px; margin-left: 8px; font-size: 11.5px; }

.metro { display: grid; grid-template-columns: repeat(6, 1fr); gap: 32px 0; padding: 2px 0 12px; }
.stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; padding: 0 4px; color: inherit; }
.stop-line { display: none; position: absolute; top: 15px; left: calc(50% + 17px); right: calc(-50% + 17px); height: 3px; background: #d5d9e0; border-radius: 2px; }
.stop.has-next .stop-line { display: block; }
.stop.is-done .stop-line { background: #a6f4c5; }
.stop.is-turn::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  width: 3px; height: 38px; background: #c8ccd4; border-radius: 2px; z-index: 0;
}
.stop-dot {
  position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: #fff; border: 2.5px solid #d0d5dd; color: #98a2b3;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stop:hover .stop-dot { transform: scale(1.07); }
.is-done .stop-dot { background: #12b76a; border-color: #12b76a; color: #fff; }
.is-current .stop-dot { background: var(--brand); border-color: var(--brand); color: #fff; animation: stopPulse 1.9s ease-out infinite; }
.is-failed .stop-dot { background: #d92d20; border-color: #d92d20; color: #fff; }
@keyframes stopPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, .35); }
  70% { box-shadow: 0 0 0 10px rgba(255, 90, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); }
}
.stop-name { font-size: 11.8px; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
.is-current .stop-name { color: var(--brand-d); }
.is-pending .stop-name { color: var(--muted); font-weight: 500; }
.stop-meta { font-size: 10.5px; color: var(--muted); }
.stop.is-open .stop-name { text-decoration: underline; text-underline-offset: 2px; }
.stop-badge {
  position: absolute; top: -2px; left: calc(50% + 8px); min-width: 17px; height: 17px; border-radius: 999px;
  background: #d92d20; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  padding: 0 4px; z-index: 2;
}

/* board ------------------------------------------------------------------ */
.board {
  border: 1px solid var(--line); border-radius: 16px; background: #fff; margin-bottom: 18px;
  scroll-margin-top: 140px; overflow: hidden;
}
.board-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 16px 20px 12px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.board-kicker { font-size: 10.8px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.board-head h2 { font-size: 20px; margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-head p { margin-top: 4px; }
.board-ready { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; border-radius: 999px; padding: 5px 12px; font-size: 12px; white-space: nowrap; }
.board-grid { display: grid; grid-template-columns: 1fr 264px; }
.board-main { padding: 12px 20px 20px; min-width: 0; }
.board-h3 { font-size: 12.5px; margin: 14px 0 8px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.board-empty { padding: 6px 0 4px; }
.cklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ck { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.ck:hover { background: #fcfcfd; }
.ck-box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #d0d5dd; background: #fff; display: grid; place-items: center; font-size: 11px; color: #fff; flex: 0 0 auto; }
.ck.is-done .ck-box { background: #12b76a; border-color: #12b76a; }
.ck-body { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; flex: 1; min-width: 0; }
.ck-txt { font-size: 13.2px; }
.ck.is-done .ck-txt { color: var(--muted); text-decoration: line-through; text-decoration-color: #d0d5dd; }
.ck-owner { font-size: 10.4px; border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.ck-owner.is-client { background: #eff8ff; color: #175cd3; }
.ck-owner.is-us { background: #fff2ec; color: var(--brand-d); }
.ck-src { font-size: 10.4px; color: #067647; }
.ck-note { font-size: 11px; color: var(--muted); }
.mini-btn { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; font-family: inherit; white-space: nowrap; }
.mini-btn:hover { border-color: var(--brand); color: var(--brand-d); }
.mini-btn.ghost { border-color: transparent; color: var(--muted); opacity: 0; transition: opacity .15s ease; }
.ck:hover .mini-btn.ghost { opacity: 1; }

.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.th { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.th.is-us { background: #fff7f3; border-color: #ffd0bd; }
.th-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.th-body { font-size: 13.2px; margin: 6px 0 0; white-space: pre-wrap; line-height: 1.6; color: var(--ink-2); }
.th-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.8px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; }
.th-file:hover { border-color: var(--brand); color: var(--brand-d); }

.board-form { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.board-form textarea { width: 100%; font-family: inherit; font-size: 13px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; resize: vertical; }
.board-form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.board-file { position: relative; font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.board-file:hover { border-color: var(--brand); color: var(--brand-d); }
.board-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.board-side { border-left: 1px solid var(--line-2); padding: 16px 18px; background: #fcfcfd; display: flex; flex-direction: column; gap: 10px; }
.side-card h4 { font-size: 11.4px; color: var(--muted); margin-bottom: 8px; letter-spacing: .06em; text-transform: uppercase; }
.side-card dl { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.side-card dl > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12.4px; }
.side-card dt { color: var(--muted); }
.side-card dd { margin: 0; font-weight: 600; }
.side-card dd.hot { color: var(--brand); }
.side-cta { display: block; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 8px; font-size: 12.5px; color: var(--ink-2); background: #fff; }
.side-cta:hover { border-color: var(--brand); color: var(--brand-d); }
.side-hint { font-size: 11px; color: var(--muted); line-height: 1.55; }

@media (max-width: 980px) {
  .metro { grid-template-columns: repeat(3, 1fr); gap: 26px 0; }
  .stop.has-next .stop-line { display: none; }
  .stop.is-turn::after { display: none; }
  .stop:nth-child(3n) { grid-column: auto; }
  .board-grid { grid-template-columns: 1fr; }
  .board-side { border-left: 0; border-top: 1px solid var(--line-2); }
}
@media (max-width: 560px) {
  .metro { grid-template-columns: 1fr; gap: 0; padding: 0 0 6px; }
  .stop { flex-direction: row; align-items: center; gap: 10px; text-align: left; padding: 8px 2px; }
  .stop.has-next .stop-line, .stop.is-turn::after { display: none; }
  .stop::before { content: ''; position: absolute; left: 14px; top: 0; bottom: 0; width: 3px; background: #d5d9e0; }
  .stop.is-done::before { background: #a6f4c5; }
  .stop:first-child::before { top: 50%; }
  .stop:last-child::before { bottom: 50%; }
  .stop-dot { flex: 0 0 auto; width: 26px; height: 26px; font-size: 11px; }
  .stop::before { left: 14px; }
  .stop-name { font-size: 13px; }
  .stop-meta { margin-left: auto; white-space: nowrap; }
  .stop-badge { left: auto; right: 2px; top: 4px; }
  .board-main { padding: 12px 14px 16px; }
  .board-head { padding: 14px 14px 10px; }
}

/* ==========================================================================
   Dashboard: order board (todo cards + funnel + mini metro)
   ========================================================================== */
.adm-dashhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.adm-dashhead h1 { font-size: 20px; }
.adm-dashhead p { margin-top: 4px; font-size: 12.8px; max-width: 52em; }
.adm-stats-4 { grid-template-columns: repeat(4, 1fr); }
.adm-todo-card { display: flex; flex-direction: column; gap: 2px; border-left: 3px solid var(--line); }
.adm-todo-card.has-work { border-left-color: var(--brand); background: #fffaf7; }
.adm-todo-card small { font-size: 10.8px; line-height: 1.4; margin-top: 2px; }

.funnel { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; padding: 14px 18px 18px; }
.fn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 4px; background: #fff;
}
.fn:hover { border-color: var(--brand); }
.fn.has { background: #fff7f3; border-color: #ffd0bd; }
.fn-seq { font-size: 9.6px; color: var(--muted); }
.fn-name { font-size: 10.6px; color: var(--ink-2); line-height: 1.2; }
.fn-n { font-size: 16px; font-weight: 800; color: #c2c8d0; }
.fn.has .fn-n { color: var(--brand); }

.mini-metro { display: inline-flex; gap: 3px; align-items: center; }
.mm { width: 9px; height: 9px; border-radius: 50%; background: #e4e7ec; display: inline-block; }
.mm-done { background: #12b76a; }
.mm-current { background: var(--brand); box-shadow: 0 0 0 2px rgba(255, 90, 31, .18); }
.mm-failed { background: #d92d20; }
.adm-table-live td { vertical-align: middle; }
.adm-table-live td b { font-size: 13px; }
.adm-num { text-align: right; }
.adm-dashsub { margin: 26px 0 12px; font-size: 11.6px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

@media (max-width: 1280px) {
  .adm-stats-4 { grid-template-columns: repeat(3, 1fr); }
  .funnel { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 720px) {
  .adm-stats-4 { grid-template-columns: repeat(2, 1fr); }
  .funnel { grid-template-columns: repeat(4, 1fr); }
}
.adm-table-live small { display: block; margin-top: 2px; }
