:root {
  --bg: #f5f7f6;
  --card: #ffffff;
  --ink: #18211d;
  --muted: #6b7771;
  --line: #e3e9e5;
  --brand: #0f766e;
  --brand-soft: #e6f4f1;
  --warn: #b45309;
  --warn-soft: #fff4df;
  --danger: #b42318;
  --danger-soft: #fef0ef;
  --ok: #157347;
  --ok-soft: #e9f7ef;
  --shadow: 0 12px 36px rgba(24, 33, 29, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}
button, input, textarea { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #dff3ee, transparent 45%), var(--bg);
}
.login-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 12px 0 4px; font-size: 28px; }
.login-card p { margin: 0 0 24px; }
.brand-mark {
  width: 54px; height: 54px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--brand); color: white;
  font-weight: 800; font-size: 24px;
}
.brand-mark.small { width: 36px; height: 36px; border-radius: 11px; font-size: 17px; }
label { display: grid; gap: 8px; margin-bottom: 16px; color: #34443c; font-weight: 600; }
input, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; background: #fff; color: var(--ink); outline: none;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.btn {
  border: 1px solid transparent; border-radius: 12px; padding: 10px 16px;
  cursor: pointer; font-weight: 700; background: #fff; color: var(--ink);
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #0b5f58; }
.btn.ghost { border-color: var(--line); background: #fff; }
.btn.ghost:hover { background: #f8faf9; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.warn { background: var(--warn); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.block { width: 100%; }
.btn.small { padding: 7px 11px; border-radius: 9px; font-size: 13px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 14px 22px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.top-actions { display: flex; gap: 8px; }
.page { max-width: 1180px; margin: 0 auto; padding: 22px 18px 60px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
}
.stat b { display: block; font-size: 24px; margin-top: 4px; }
.stat span { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; }
.tab {
  white-space: nowrap; border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; font-weight: 700;
}
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.order-list { display: grid; gap: 12px; }
.order-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px; box-shadow: 0 4px 18px rgba(24,33,29,.03);
  display: grid; gap: 10px;
}
.order-card:hover { border-color: #c9d8d2; }
.order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.order-no { font-weight: 800; letter-spacing: .2px; }
.order-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 800; }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.active { background: var(--brand-soft); color: var(--brand); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; color: #35453d; }
.order-grid div { min-width: 0; }
.order-grid small { color: var(--muted); display: block; font-size: 12px; margin-bottom: 2px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px dashed var(--line); padding-top: 11px; }
.amount { font-size: 19px; font-weight: 800; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; background: #fafcfb; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(9, 20, 15, .3); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--card); z-index: 21; box-shadow: -16px 0 50px rgba(9,20,15,.16);
  display: flex; flex-direction: column;
}
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 4px 0 0; font-size: 20px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.icon-btn { border: 0; background: #f2f5f3; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.drawer-body { overflow: auto; padding: 18px 22px 32px; }
.section { margin-bottom: 22px; }
.section h3 { font-size: 14px; color: var(--muted); margin: 0 0 10px; letter-spacing: .04em; }
.kv { display: grid; grid-template-columns: 104px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.items { display: grid; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.item b { display: block; margin-bottom: 3px; }
.proofs { display: flex; flex-wrap: wrap; gap: 8px; }
.proofs a { display: block; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #f4f7f5; }
.proofs img { width: 100%; height: 100%; object-fit: cover; }
.timeline { display: grid; gap: 10px; }
.log { display: grid; grid-template-columns: 10px 1fr; gap: 10px; }
.log-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 5px; }
.log small { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.checkline { display: flex; align-items: center; gap: 9px; margin: 4px 0 14px; font-weight: 600; }
.checkline input { width: auto; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.notice { background: var(--brand-soft); color: #0b5f58; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #18211d; color: #fff; padding: 11px 18px; border-radius: 999px;
  z-index: 40; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
@media (max-width: 620px) {
  .order-grid, .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; }
  .brand span:last-child { font-size: 14px; }
  .page { padding: 16px 12px 50px; }
  .drawer { width: 100%; }
}
