/* Meicheng order system — standalone. Primary blue sampled from the company logo: #1C7CD0 */
:root {
  --primary: #1C7CD0;
  --primary-dark: #1565A8;
  --bg: #f2f5f8;
  --card: #ffffff;
  --border: #dbe4ec;
  --text: #1f2a36;
  --muted: #6b7c8d;
  --green: #1e9e62;
  --red: #d64545;
  --amber: #d98a00;
  --purple: #7a5fd0;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(28,124,208,.25); border-color: var(--primary); }
input.err, select.err, textarea.err { border-color: var(--red); background: #fff5f5; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
label .req { color: var(--red); }
.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 6px; background: var(--primary); color: #fff; font-size: 14px; }
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: var(--red); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; color: #fff; }
.badge.confirmed { background: var(--primary); }
.badge.dispatched { background: var(--purple); }
.badge.completed { background: var(--green); }
.badge.cancelled { background: var(--red); }
.badge.due { background: var(--amber); }
.badge.gray { background: #8a9aa8; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.08); padding: 32px 28px; width: 360px; max-width: 100%; }
.login-card h1 { margin: 6px 0 4px; font-size: 22px; }
.login-card .sub { color: var(--muted); margin: 0 0 18px; }
.login-logo { width: 64px; height: 64px; border-radius: 12px; background: #e8f2fb; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--primary); }
.errbox { background: #fdecea; color: var(--red); border: 1px solid #f5c6c0; border-radius: 6px; padding: 8px 10px; margin: 10px 0; font-size: 13px; }
.okbox { background: #e6f6ee; color: var(--green); border: 1px solid #bfe8d2; border-radius: 6px; padding: 8px 10px; margin: 10px 0; font-size: 13px; }
/* app shell */
.topbar { background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 52px; position: sticky; top: 0; z-index: 10; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--primary); }
.topbar .brand .logo { width: 32px; height: 32px; border-radius: 8px; background: #e8f2fb; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--muted); font-size: 13px; }
.nav { background: #fff; border-bottom: 1px solid var(--border); display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; }
.nav button { border: none; background: none; padding: 11px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.nav button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.ovcard { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; cursor: pointer; }
.ovcard:hover { border-color: var(--primary); }
.ovcard .n { font-size: 26px; font-weight: 700; }
.ovcard .t { color: var(--muted); font-size: 13px; margin-top: 2px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.panel h2 { margin: 0 0 10px; font-size: 16px; }
.panel h3 { margin: 14px 0 6px; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filters > div { min-width: 120px; flex: 1; }
.filters label { margin: 0 0 3px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eef2f5; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tr:hover td { background: #f7fafc; }
.order-card { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.order-card:hover { border-color: var(--primary); }
.order-card .title { font-weight: 600; font-size: 15px; }
.order-card .meta { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.6; }
.order-card .amounts { margin-top: 6px; font-size: 13px; }
.order-card .amounts .sell { font-weight: 700; font-size: 15px; }
.tabs { display: flex; gap: 4px; background: #e9eef3; border-radius: 8px; padding: 3px; margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 7px 14px; border-radius: 6px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tabs button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 14px; }
.kv .k { color: var(--muted); }
pre.raw { background: #f7fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px; line-height: 1.7; margin: 0; }
.warn { background: #fff8e6; border: 1px solid #f0d48a; color: #8a6d00; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.hint { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } .cards { grid-template-columns: 1fr; } .kv { grid-template-columns: 90px 1fr; } }
/* calendar */
.cal { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0; border-bottom: 1px solid #eef2f5; }
.cal-day { min-height: 74px; border-bottom: 1px solid #eef2f5; border-right: 1px solid #eef2f5; padding: 6px; cursor: pointer; position: relative; }
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: #f0f7fd; }
.cal-day .dnum { font-size: 13px; font-weight: 600; }
.cal-day .cnt { font-size: 12px; margin-top: 4px; }
.cal-day.busy1 { background: #e8f2fb; }
.cal-day.busy2 { background: #cfe5f8; }
.cal-day.busy3 { background: #a8d0f2; }
.cal-day.busy4 { background: #7fb8e8; color: #fff; }
.cal-day.busy4 .cnt { color: #fff; }
.cal-day.other { opacity: .35; cursor: default; }
.cal-day .red { color: var(--red); font-weight: 700; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 720px; max-width: 100%; padding: 20px; }
.modal h2 { margin: 0 0 12px; }
.dayrow { display: flex; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef2f5; }
.dayrow input { width: 90px; }
.tag { display: inline-block; background: #eef4f9; border-radius: 4px; padding: 1px 7px; font-size: 12px; color: var(--muted); margin-right: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-left: 4px; vertical-align: middle; }
