/* msshop 铭商门店云 · 后台样式 */
:root {
  --brand: #f26522;
  --brand-dark: #d94f12;
  --brand-soft: #fff1e9;
  --ink: #14171f;
  --ink-2: #3b4152;
  --muted: #7a8194;
  --line: #e8eaef;
  --bg: #f4f5f8;
  --card: #ffffff;
  --ok: #16a34a;
  --ok-soft: #e9f8ef;
  --warn: #d97706;
  --warn-soft: #fef4e4;
  --info: #2563eb;
  --info-soft: #eaf1ff;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --violet: #7c3aed;
  --violet-soft: #f1ebff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -16px rgba(16, 24, 40, .18);
  --side: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
svg.sprite { display: none; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  background: linear-gradient(180deg, #171a23 0%, #10121a 100%);
  color: #c8cdd9; display: flex; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, #ff8a3d, var(--brand));
  display: grid; place-items: center; font-weight: 700; font-size: 19px;
  box-shadow: 0 6px 16px -6px rgba(242, 101, 34, .8);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.brand-text strong { font-size: 15px; letter-spacing: .3px; white-space: nowrap; }
.brand-text em { font-style: normal; font-size: 11px; color: #7d8598; white-space: nowrap; }
.nav { flex: 1; padding: 6px 12px 16px; overflow-y: auto; }
.nav-label {
  font-size: 11px; color: #6a7286; letter-spacing: 1px;
  margin: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: #b9c0cf; font-size: 14px; margin-bottom: 2px; transition: .15s;
}
.nav-item .ico { width: 17px; height: 17px; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(242, 101, 34, .22), rgba(242, 101, 34, .06));
  color: #fff; box-shadow: inset 2px 0 0 var(--brand);
}
.nav-item.active .ico { opacity: 1; color: #ff9a5e; }
.side-foot {
  margin: 0 14px 16px; padding: 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .04); font-size: 12px; color: #98a0b3;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.side-foot em { margin-left: auto; font-style: normal; color: #5f6779; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }

.main { flex: 1; margin-left: var(--side); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
}
.crumb { font-size: 13px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.chip-soft { background: var(--brand-soft); border-color: #ffe0cd; color: var(--brand-dark); }
.userbox { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffb27a, var(--brand)); color: #fff; font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 13px; }
.user-meta em { font-style: normal; font-size: 11px; color: var(--muted); }
.userbox form { display: flex; }

.page { padding: 22px; max-width: 1360px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; letter-spacing: .2px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; cursor: pointer; background: #fff; color: var(--ink-2);
  transition: .15s; white-space: nowrap;
}
.btn .ico { width: 15px; height: 15px; }
.btn-primary { background: linear-gradient(135deg, #ff7c3a, var(--brand)); color: #fff; box-shadow: 0 6px 14px -8px rgba(242, 101, 34, .9); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { background: #f7f8fa; }
.btn-danger { color: var(--danger); border-color: #f3cfcf; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.disabled { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: #f2f3f6; color: var(--ink); }
.only-mobile { display: none; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* ---------- 数据卡 ---------- */
.stat { position: relative; padding: 16px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; right: -30px; top: -40px; width: 110px; height: 110px;
  border-radius: 50%; background: rgba(242, 101, 34, .07);
}
.stat-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand);
}
.stat-ico .ico { width: 21px; height: 21px; }
.stat-ico.green { background: var(--ok-soft); color: var(--ok); }
.stat-ico.blue { background: var(--info-soft); color: var(--info); }
.stat-ico.violet { background: var(--violet-soft); color: var(--violet); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.4px; line-height: 1.2; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
thead th {
  text-align: left; font-size: 11.5px; letter-spacing: .6px; color: var(--muted);
  font-weight: 600; padding: 11px 16px; background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid #f1f2f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .strong { font-weight: 600; }
td .sub, .sub { color: var(--muted); font-size: 12px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.link { color: var(--info); cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); }
.link.muted { color: var(--muted); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.b-pending { background: var(--warn-soft); color: var(--warn); }
.b-preparing { background: var(--info-soft); color: var(--info); }
.b-serving { background: var(--violet-soft); color: var(--violet); }
.b-completed { background: var(--ok-soft); color: var(--ok); }
.b-cancelled { background: #f1f2f5; color: #8a90a0; }
.b-paid { background: var(--ok-soft); color: var(--ok); }
.b-unpaid { background: var(--warn-soft); color: var(--warn); }
.b-refunded { background: #f1f2f5; color: #8a90a0; }
.b-on { background: var(--ok-soft); color: var(--ok); }
.b-off { background: #f1f2f5; color: #8a90a0; }
.b-active { background: var(--ok-soft); color: var(--ok); }
.b-paused, .b-disabled { background: #f1f2f5; color: #8a90a0; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="tel"], input[type="search"], select, textarea {
  height: 38px; padding: 0 11px; border: 1px solid #dcdfe6; border-radius: 9px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); background: #fff; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 82px; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(242, 101, 34, .14);
}
input::placeholder, textarea::placeholder { color: #aab0be; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8194' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.form-actions { display: flex; gap: 10px; padding-top: 6px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.switch input { width: 16px; height: 16px; accent-color: var(--brand); }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .search { position: relative; min-width: 230px; }
.toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.toolbar .search input { padding-left: 33px; height: 36px; }
.toolbar select { width: auto; min-width: 120px; height: 36px; }
.toolbar .actions { margin-left: auto; display: flex; gap: 8px; }
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 7px 12px 11px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .count { font-size: 11px; background: #f1f2f5; border-radius: 999px; padding: 1px 6px; margin-left: 4px; color: var(--ink-2); }
.tab.active .count { background: var(--brand-soft); color: var(--brand-dark); }

/* 分页 / 空态 / 提示 */
.pager { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager-info { color: var(--muted); font-size: 12px; }
.pager-btns { margin-left: auto; display: flex; gap: 8px; }
.empty { padding: 54px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ico { width: 34px; height: 34px; color: #c3c8d4; }
.empty strong { color: var(--ink-2); font-weight: 500; }
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 10px;
  font-size: 13px; border: 1px solid;
}
.flash .ico { width: 16px; height: 16px; }
.flash.ok { background: var(--ok-soft); color: #14692f; border-color: #c8eed8; }
.flash.error { background: var(--danger-soft); color: #a51f1f; border-color: #f6cfcf; }

/* 详情 */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-2); }
.total-line { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 14px 18px; border-top: 1px dashed var(--line); }
.total-line strong { font-size: 19px; color: var(--brand-dark); }
.flow-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qty-input { width: 66px; height: 32px; text-align: center; }
.dish-pick { max-height: 460px; overflow-y: auto; }
.dish-pick .row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #f2f3f6; }
.dish-pick .row:last-child { border-bottom: 0; }
.dish-pick .name { font-weight: 500; }
.dish-pick .meta { color: var(--muted); font-size: 12px; }
.dish-pick .price { margin-left: auto; color: var(--brand-dark); font-weight: 600; }

/* 图表 */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 38px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #ff9a5e, var(--brand)); min-height: 4px; transition: .3s; }
.bar-col:hover .bar { filter: brightness(1.06); }
.bar-label { font-size: 11px; color: var(--muted); }
.bar-value { font-size: 11px; color: var(--ink-2); font-weight: 600; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.login-brand {
  position: relative; overflow: hidden; padding: 52px;
  background: radial-gradient(120% 100% at 0% 0%, #2a2f3d 0%, #12141c 55%, #0b0d12 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  right: -180px; top: -160px; background: radial-gradient(circle, rgba(242, 101, 34, .38), transparent 65%);
}
.login-brand::after {
  content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%;
  left: -160px; bottom: -180px; background: radial-gradient(circle, rgba(37, 99, 235, .22), transparent 65%);
}
.login-brand > * { position: relative; z-index: 1; }
.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo .brand-mark { width: 44px; height: 44px; font-size: 22px; border-radius: 13px; }
.login-logo strong { font-size: 18px; }
.login-logo em { display: block; font-style: normal; font-size: 12px; color: #8e95a8; }
.login-copy h2 { font-size: 34px; line-height: 1.3; letter-spacing: -.5px; margin-bottom: 14px; }
.login-copy h2 span { background: linear-gradient(90deg, #ff8a3d, #ff5f2e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-copy p { color: #9aa1b3; font-size: 14px; max-width: 400px; }
.login-points { display: grid; gap: 14px; margin-top: 30px; }
.login-point { display: flex; gap: 12px; align-items: flex-start; }
.login-point .ico { width: 18px; height: 18px; color: #ff9a5e; margin-top: 2px; }
.login-point strong { display: block; font-size: 13.5px; }
.login-point span { font-size: 12.5px; color: #8e95a8; }
.login-foot { font-size: 12px; color: #6d7488; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-card { width: 100%; max-width: 372px; }
.login-card h1 { font-size: 24px; letter-spacing: -.3px; }
.login-card > p { color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.login-card .field { margin-bottom: 14px; }
.login-card input { height: 44px; }
.login-card .btn { width: 100%; height: 44px; font-size: 14.5px; margin-top: 6px; }
.login-tip { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: #fafbfc; border: 1px dashed #e2e5ea; font-size: 12px; color: var(--muted); line-height: 1.7; }
.login-tip b { color: var(--ink-2); }

/* ---------- 厨房看板 ---------- */
.kitchen {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px;
}
.kcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  border-top: 4px solid var(--brand);
}
.kcard.k-pending { border-top-color: var(--warn); }
.kcard.k-preparing { border-top-color: var(--info); }
.kcard.k-serving { border-top-color: var(--violet); }
.kcard.overdue { border-top-color: var(--danger); background: #fffafa; }
.kcard.overdue .khead strong { color: var(--danger); }
.khead { display: flex; align-items: center; gap: 8px; }
.khead strong { font-size: 19px; letter-spacing: .5px; }
.khead .badge { margin-left: auto; }
.kmeta { font-size: 12px; color: var(--muted); margin: 5px 0 9px; }
.kitems { list-style: none; margin: 0; padding: 0; flex: 1; }
.kitems li {
  display: flex; gap: 7px; font-size: 13.5px; padding: 5px 0;
  border-bottom: 1px dashed #f2f3f6;
}
.kitems li:last-child { border-bottom: 0; }
.kitems li b { color: var(--brand-dark); flex: none; min-width: 26px; }
.kitems li em { font-style: normal; color: var(--warn); font-size: 12px; }
.kremark {
  font-size: 12px; color: var(--warn); background: var(--warn-soft);
  border-radius: 7px; padding: 6px 8px; margin: 8px 0 0;
}
.kfoot { display: flex; align-items: center; gap: 10px; margin-top: 11px; }

/* 进度条 */
.track { height: 6px; border-radius: 999px; background: #f1f2f5; overflow: hidden; margin: 5px 0 2px; }
.track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff9a5e, var(--brand)); }

/* 批量导入 */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 30px 16px; border: 2px dashed #d6d9e0; border-radius: 12px;
  background: #fbfbfc; cursor: pointer; text-align: center; transition: .15s;
}
.drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.drop input[type="file"] { display: none; }
.drop strong { font-size: 13.5px; }
.filename { margin: 10px 0 0; font-size: 12.5px; color: var(--ok); text-align: center; }
.issue-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--warn); line-height: 1.9; }
.row-warn { background: #fffaf3; }
.row-total { background: #fafbfc; font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* 错误页 */

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.error-card { max-width: 420px; text-align: center; padding: 44px 36px; }
.error-card .code { font-size: 56px; font-weight: 800; letter-spacing: -2px; background: linear-gradient(135deg, #ff8a3d, var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-card p { color: var(--muted); margin: 8px 0 22px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.nav-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .only-mobile { display: grid; }
  .page { padding: 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-brand { display: none; }
  .user-meta { display: none; }
  .toolbar .search { min-width: 0; width: 100%; }
  table { min-width: 560px; }
}
