/* =========================================================
   美卡卡派协作台 · Design System
   ========================================================= */
:root {
  --navy: #0B2545;
  --navy-2: #12345C;
  --navy-3: #1B4A75;
  --orange: #F97316;
  --orange-2: #EA580C;
  --orange-soft: #FFF3E8;
  --bg: #F3F5F9;
  --card: #FFFFFF;
  --line: #E4E9F1;
  --line-soft: #EEF2F7;
  --text: #14213A;
  --muted: #73829B;
  --muted-2: #9AA6B8;
  --red: #C0392B;
  --green: #059669;
  --amber: #B45309;
  --violet: #6D28D9;
  --teal: #0F766E;
  --indigo: #4338CA;
  --blue: #1D4ED8;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 35, 60, .04);
  --shadow: 0 1px 2px rgba(15, 35, 60, .04), 0 10px 28px -12px rgba(15, 35, 60, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: rgba(249, 115, 22, .18); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -.2px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
svg.ico { flex: none; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #CDD5E0; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #B6C0CF; background-clip: content-box; border: 3px solid transparent; }

/* =========================================================
   Shell / Sidebar
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 246px; z-index: 50;
  background: linear-gradient(180deg, #0B2545 0%, #0A1F3B 100%);
  color: #fff; display: flex; flex-direction: column; padding: 18px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FB923C, #F97316); color: #fff; flex: none;
  box-shadow: 0 6px 16px -6px rgba(249, 115, 22, .7);
}
.brand-mark.sm { width: 32px; height: 32px; border-radius: 9px; }
.brand-mark.lg { width: 52px; height: 52px; border-radius: 15px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: 2px; font-weight: 700; }
.brand-text i { font-style: normal; font-size: 10px; color: rgba(255, 255, 255, .5); letter-spacing: 2.5px; margin-top: 3px; }

.nav-cta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; border-radius: 10px; margin: 0 4px 18px;
  background: linear-gradient(135deg, #F97316, #EA580C); color: #fff;
  font-weight: 600; font-size: 13.5px; box-shadow: 0 8px 20px -10px rgba(249, 115, 22, .9);
  transition: .16s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(249, 115, 22, 1); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10px; letter-spacing: 2px; color: rgba(255, 255, 255, .32); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px;
  border-radius: 10px; color: rgba(255, 255, 255, .72); font-size: 13.5px; font-weight: 500;
  position: relative; transition: .15s;
}
.nav-item svg { opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--orange);
}
.nav-item.active svg { opacity: 1; color: #FDBA74; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.side-card {
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px; padding: 12px; margin: 0 2px;
}
.side-card-title { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .8); margin-bottom: 6px; }
.side-card p { margin: 0; font-size: 11px; line-height: 1.6; color: rgba(255, 255, 255, .45); }
.user-mini { display: flex; align-items: center; gap: 9px; padding: 8px 8px 2px; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-mini-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-mini-info b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini-info i { font-style: normal; font-size: 10px; color: rgba(255, 255, 255, .4); margin-top: 2px; }
.user-mini .icon-btn { margin-left: auto; color: rgba(255, 255, 255, .5); }
.user-mini .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FFD7B5, #FDBA74); color: #7C2D12; font-weight: 700; font-size: 14px;
  flex: none; letter-spacing: 0;
}
.avatar.xs { width: 24px; height: 24px; font-size: 11px; }
.icon-btn {
  width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: .15s;
}
.icon-btn:hover { background: #F1F4F8; color: var(--text); }

.main { flex: 1; margin-left: 246px; min-width: 0; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  height: 64px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px;
  padding: 0 26px; position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title { font-size: 14px; font-weight: 600; color: #29374F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-brand { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.gsearch { position: relative; }
.gsearch-box {
  display: flex; align-items: center; gap: 8px; width: 288px; height: 38px; padding: 0 10px;
  background: #F2F5F9; border: 1px solid transparent; border-radius: 10px; color: var(--muted-2); transition: .15s;
}
.gsearch-box:focus-within { background: #fff; border-color: #F7C9A5; box-shadow: 0 0 0 3px rgba(249, 115, 22, .1); }
.gsearch-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--text); }
.gsearch-box kbd {
  font-family: var(--font); font-size: 10px; color: #94A3B8; border: 1px solid #DCE3EC; background: #fff;
  border-radius: 5px; padding: 1px 5px; line-height: 1.4;
}
.gsearch-panel {
  position: absolute; top: 46px; right: 0; width: 360px; max-height: 420px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px -12px rgba(15, 35, 60, .25);
  padding: 6px; display: none; z-index: 60;
}
.gsearch-panel.open { display: block; }
.gs-empty { padding: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; }
.gs-item:hover { background: #F6F8FB; }
.gs-code { font-family: var(--mono); font-weight: 700; font-size: 12.5px; color: var(--navy); }
.gs-cust { font-size: 12.5px; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-status { font-size: 10.5px; color: var(--muted); }

.content { padding: 24px 26px 48px; width: 100%; max-width: 1360px; margin: 0 auto; }

/* =========================================================
   Buttons / Forms / Cards
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: .16s; color: var(--text);
  background: #fff;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: linear-gradient(135deg, #F97316, #EA580C); color: #fff; box-shadow: 0 6px 16px -8px rgba(249, 115, 22, .9); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(249, 115, 22, 1); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-ghost { background: #fff; border-color: var(--line); color: #334155; }
.btn-ghost:hover { border-color: #C9D4E3; background: #FBFCFE; }
.btn-text { background: transparent; color: var(--muted); padding: 0 8px; }
.btn-text:hover { color: var(--text); background: #F3F6FA; }
.btn-light { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(4px); }
.btn-light:hover { background: rgba(255, 255, 255, .22); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.danger-text { color: #DC2626; }
.danger-text:hover { background: #FEF2F2; color: #B91C1C; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.card-head h3, .side-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.link-more { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.link-more:hover { color: var(--orange-2); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.4px; }
.page-sub { margin: 0; font-size: 12.5px; color: var(--muted); }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.back-link:hover { color: var(--orange-2); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 600; color: #475569; }
.field-label i { font-style: normal; font-weight: 400; color: var(--muted-2); }
.input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 0 12px; font-size: 14px; color: var(--text); outline: 0; transition: .15s;
}
.input:focus { border-color: #F7B183; box-shadow: 0 0 0 3px rgba(249, 115, 22, .1); }
.field-hint { font-size: 11px; color: var(--muted-2); }
.select {
  height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  padding: 0 28px 0 10px; font-size: 12.5px; color: var(--text); outline: 0;
  appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2373829B' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
}
.select:focus { border-color: #F7B183; box-shadow: 0 0 0 3px rgba(249, 115, 22, .1); }
.select.sm { height: 34px; font-size: 12.5px; }

/* =========================================================
   Pills / tags
   ========================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: #F1F4F8; color: #475569;
}
.pill.sm { height: 19px; font-size: 10.5px; padding: 0 7px; }
.st-inquiry { background: #E8F1FF; color: #1D4ED8; }
.st-customer_filled { background: #E3F6FA; color: #0E7490; }
.st-broker_quoted { background: #FFF0E4; color: #C2410C; }
.st-quoted { background: #FFF4E3; color: #B45309; }
.st-confirmed { background: #F3EEFF; color: #6D28D9; }
.st-paid { background: #E4FAF6; color: #0F766E; }
.st-dispatched { background: #EEF0FF; color: #4338CA; }
.st-delivered { background: #E6F8EE; color: #047857; }
.st-cancelled { background: #F1F3F6; color: #64748B; }
.mini-tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px;
  font-size: 10px; font-weight: 600; background: #EDF1F7; color: #64748B; margin-left: 6px; vertical-align: 1px;
}
.mini-tag.gold { background: #FFF4E3; color: #B45309; }
.count-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #F1F4F8; color: #64748B; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }

/* =========================================================
   Dashboard
   ========================================================= */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px;
  background: radial-gradient(120% 160% at 100% 0%, #1B4A75 0%, #0B2545 55%, #081C36 100%);
  color: #fff; margin-bottom: 18px; box-shadow: 0 18px 40px -24px rgba(11, 37, 69, .8);
}
.hero-inner { position: relative; z-index: 2; max-width: 680px; }
.eyebrow { display: inline-block; font-size: 9.5px; letter-spacing: 2.6px; color: #FDBA74; font-weight: 600; margin-bottom: 8px; }
.hero-copy h2 { margin: 0 0 5px; font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.hero-copy p { margin: 0 0 16px; font-size: 12.5px; color: rgba(255, 255, 255, .55); }
.hero-search {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 13px;
  padding: 6px 6px 6px 14px; max-width: 540px; color: var(--muted-2); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .4);
}
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; height: 38px; font-size: 14px; color: var(--text); background: transparent; }
.hero-search .btn { height: 38px; border-radius: 9px; }
.hero-chips { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; color: rgba(255, 255, 255, .45); flex-wrap: wrap; }
.hero-chips a { color: rgba(255, 255, 255, .78); background: rgba(255, 255, 255, .09); padding: 2px 9px; border-radius: 6px; font-family: var(--mono); font-size: 11px; }
.hero-chips a:hover { background: rgba(255, 255, 255, .18); }
.hero-chips i { font-style: normal; }
.hero-art { position: absolute; right: -10px; bottom: -10px; width: 340px; opacity: .9; pointer-events: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat-icon.blue { background: #EAF1FF; color: #2563EB; }
.stat-icon.amber { background: #FFF4E3; color: #D97706; }
.stat-icon.teal { background: #E4FAF6; color: #0F766E; }
.stat-icon.green { background: #E6F8EE; color: #059669; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-body span { font-size: 11.5px; color: var(--muted); }
.stat-body b { font-size: 23px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; margin: 1px 0 2px; }
.stat-body b small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.stat-body i { font-style: normal; font-size: 10.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grid-main { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }

.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .3px;
  padding: 9px 12px; background: #FAFBFD; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #FAFCFF; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code-link { font-family: var(--mono); font-weight: 700; font-size: 12.5px; color: var(--navy); letter-spacing: -.2px; white-space: nowrap; }
.code-link:hover { color: var(--orange-2); text-decoration: underline; }
.cell-strong { font-weight: 600; color: #1E293B; }
.cell-sub { display: block; font-style: normal; font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }
.route { font-size: 11.5px; color: #475569; display: block; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route i { font-style: normal; color: #CBD5E1; }
.cell-sub + .route { margin-top: 2px; }

.follow-list { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 7px; }
.follow-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; transition: .15s; }
.follow-item:hover { border-color: #F7C9A5; background: #FFFCF9; }
.follow-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.follow-top b { font-family: var(--mono); font-size: 12.5px; }
.follow-customer { font-size: 12px; color: #334155; }
.follow-meta { font-size: 10.5px; color: var(--muted-2); display: flex; align-items: center; gap: 3px; margin-top: 2px; }

.activity-feed { padding: 0 18px 14px; }
.act-item { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.act-item:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 20px; bottom: -6px; width: 1px; background: var(--line); }
.act-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: #CBD5E1; box-shadow: 0 0 0 3px #fff; z-index: 1; }
.act-main { min-width: 0; }
.act-line { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.act-line b { color: #1E293B; font-weight: 600; }
.act-meta { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.code-chip { font-family: var(--mono); font-size: 10.5px; background: #F1F4F8; border-radius: 5px; padding: 1px 6px; color: #334155; }
.code-chip:hover { background: var(--orange-soft); color: var(--orange-2); }

/* Action colors */
.act-create { background: #10B981; }
.act-update { background: #3B82F6; }
.act-status { background: #8B5CF6; }
.act-share { background: #F59E0B; }
.act-attachment { background: #14B8A6; }
.act-export { background: #6366F1; }
.act-login { background: #94A3B8; }
.act-duplicate { background: #0EA5E9; }
.act-archive { background: #64748B; }
.act-delete { background: #EF4444; }
.act-template { background: #A855F7; }
.act-password, .act-profile { background: #64748B; }
.act-user { background: #0EA5E9; }
.act-backup { background: #0F766E; }
.act-logout { background: #94A3B8; }

/* =========================================================
   Orders list
   ========================================================= */
.filter-bar { padding: 12px; margin-bottom: 12px; }
.filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-inline {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; min-width: 240px;
  flex: 1 1 260px;
  background: #F7F9FC; border: 1px solid transparent; border-radius: 9px; color: var(--muted-2);
}
.search-inline:focus-within { background: #fff; border-color: #F7C9A5; box-shadow: 0 0 0 3px rgba(249, 115, 22, .08); }
.search-inline input { border: 0; outline: 0; background: transparent; font-size: 13px; width: 100%; color: var(--text); }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; padding: 0 4px; }
.check-inline input { accent-color: var(--orange); width: 15px; height: 15px; }

.status-tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 8px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap; font-weight: 500;
}
.tab i { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
.tab:hover { background: #fff; color: var(--text); }
.tab.active { background: #fff; color: var(--navy); font-weight: 600; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.tab.active i { color: var(--orange-2); }

.list-card { overflow: hidden; }
.orders-table td:first-child { white-space: nowrap; width: 92px; }
.data-table td:first-child .code-link { white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn { color: var(--muted); }
.row-actions .btn:hover { color: var(--orange-2); }

.mobile-cards { display: none; padding: 10px; gap: 10px; }
.order-card { display: flex; flex-direction: column; gap: 4px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; }
.order-card:active { background: #FAFCFF; }
.oc-top { display: flex; align-items: center; justify-content: space-between; }
.oc-top b { font-family: var(--mono); font-size: 14px; }
.oc-customer { font-size: 12.5px; color: #334155; }
.oc-customer i { font-style: normal; color: var(--muted-2); }
.oc-route { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.oc-route span { color: #CBD5E1; }
.oc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding-top: 7px; border-top: 1px dashed var(--line); }
.oc-foot span { font-size: 10.5px; color: var(--muted-2); }
.oc-foot b { font-size: 13px; color: var(--navy); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 14px; border-top: 1px solid var(--line-soft); }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 7px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted); border: 1px solid transparent;
}
.page-btn:hover { background: #F1F5F9; color: var(--text); }
.page-btn.active { background: var(--navy); color: #fff; font-weight: 600; }
.page-btn.disabled { opacity: .35; pointer-events: none; }
.page-dots { color: var(--muted-2); padding: 0 2px; font-size: 12px; }

/* =========================================================
   New order
   ========================================================= */
.new-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin: 4px 0 10px; }
.section-title i { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted-2); }
.step-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.tpl-card {
  position: relative; display: flex; gap: 12px; padding: 12px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 13px; cursor: pointer; transition: .16s;
}
.tpl-card:hover { border-color: #C9D6E6; }
.tpl-card.selected { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249, 115, 22, .1); }
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-thumb {
  width: 106px; flex: none; background: #FAFBFD; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 6px; min-height: 112px; display: flex; flex-direction: column; gap: 4px;
}
.tt-title { font-size: 7.5px; font-weight: 700; text-align: center; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-table { display: flex; flex-direction: column; gap: 2px; }
.tt-row { display: flex; gap: 2px; }
.tt-label { font-size: 5.5px; color: var(--red); border: .5px solid #D8DEE7; padding: 2px 1px; text-align: center; overflow: hidden; white-space: nowrap; border-radius: 1px; background: #fff; }
.tt-more { font-size: 6px; color: var(--muted-2); text-align: center; margin-top: auto; }
.tpl-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }
.tpl-name { display: flex; align-items: center; gap: 2px; }
.tpl-name b { font-size: 13px; font-weight: 700; }
.tpl-info p { margin: 0; font-size: 10.5px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-meta { font-size: 10px; color: var(--muted-2); margin-top: auto; }
.tpl-check {
  position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--orange); color: #fff; display: none; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px -2px rgba(249, 115, 22, .8);
}
.tpl-card.selected .tpl-check { display: flex; }
.form-card { padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.single-tpl { display: flex; align-items: center; gap: 14px; padding: 15px 18px; margin-bottom: 4px; }
.single-tpl-icon { width: 44px; height: 44px; border-radius: 12px; background: #FFF4EA; color: var(--orange-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.single-tpl-main { flex: 1; min-width: 0; }
.single-tpl-main b { font-size: 14px; display: block; }
.single-tpl-main p { margin: 3px 0 5px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.single-tpl-main span { font-size: 11px; color: var(--muted-2); }
.new-side { position: sticky; top: 84px; }
.sticky-card { padding: 16px; }
.sticky-card h3 { margin: 0 0 12px; font-size: 13px; }
.preview-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.preview-row span { color: var(--muted); }
.preview-row b { font-weight: 600; text-align: right; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-note { display: flex; gap: 6px; font-size: 10.5px; line-height: 1.55; color: var(--muted-2); background: #F7F9FC; border-radius: 8px; padding: 9px 10px; margin: 12px 0; }
.preview-note svg { color: var(--green); margin-top: 1px; }
.preview-note + .btn { margin-bottom: 6px; }

/* =========================================================
   Order detail
   ========================================================= */
.order-head { align-items: flex-start; }
.order-head-main { min-width: 0; }
.title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-line h1 { font-family: var(--mono); font-size: 27px; letter-spacing: -1px; margin: 0; }
.order-actions { align-items: center; }
.presence { display: flex; align-items: center; margin-right: 2px; }
.presence .p-avatar { width: 26px; height: 26px; border-radius: 50%; background: #E8F1FF; color: #1D4ED8; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; margin-left: -6px; }
.presence .p-text { font-size: 10.5px; color: var(--muted); margin-left: 5px; display: none; }
@media (min-width: 1200px) { .presence .p-text { display: inline; } }

.dropdown { position: relative; }
.dropdown > .menu {
  position: absolute; right: 0; top: 44px; min-width: 196px; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; box-shadow: 0 20px 50px -14px rgba(15, 35, 60, .28); padding: 5px; display: none; z-index: 70;
}
.dropdown.open > .menu { display: block; }
.dropdown .menu a, .dropdown .menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: transparent;
  border-radius: 7px; font-size: 12.5px; color: #334155; text-align: left;
}
.dropdown .menu a:hover, .dropdown .menu button:hover { background: #F5F8FB; }
.dropdown .menu a i { font-style: normal; font-size: 10px; color: var(--muted-2); margin-left: auto; }
.dropdown .menu .danger { color: #DC2626; }
.dropdown .menu .danger:hover { background: #FEF2F2; }

.applied-tip {
  display: flex; align-items: center; gap: 8px; background: #ECFDF5; border: 1px solid #BBF7D0; color: #047857;
  font-size: 12px; border-radius: 9px; padding: 8px 12px; margin-bottom: 12px;
}
.applied-tip .dot { width: 7px; height: 7px; border-radius: 50%; background: #10B981; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 16px; align-items: start; }
.detail-main { min-width: 0; }

.sheet-card { overflow: hidden; }
.sheet-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft); background: #FAFBFD;
}
.save-state { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.save-state b { font-weight: 600; color: #059669; }
.save-state i { font-style: normal; color: var(--muted-2); font-size: 10.5px; }
.save-state .dot, .ms-state .dot, .share-savebar .dot { width: 7px; height: 7px; border-radius: 50%; background: #10B981; display: inline-block; }
.dot.warn { background: #F59E0B !important; animation: pulse 1.1s infinite; }
.dot.err { background: #EF4444 !important; }
.save-state.dirty b { color: #B45309; }
.save-state.saving b { color: #B45309; }
.save-state.saving .dot { background: #F59E0B; animation: pulse 1.1s infinite; }
.save-state.error b { color: #DC2626; }
.save-state.error .dot { background: #EF4444; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.sheet-legend { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted-2); flex-wrap: wrap; }
.lg-red, .lg-black { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.lg-red { background: rgba(192, 57, 43, .7); }
.lg-black { background: #334155; }

.sheet-wrap { padding: 22px; background: #F8FAFD; }
.sheet {
  background: #fff; border: 1px solid #2B2B2B; padding: 20px 18px 16px;
  box-shadow: 0 8px 26px -18px rgba(15, 35, 60, .3);
}
.sheet-title { text-align: center; font-size: 23px; font-weight: 700; letter-spacing: 3px; margin: 0 0 2px; color: #111; }
.sheet-sub { text-align: center; font-size: 8.5px; letter-spacing: 2.4px; color: #9AA6B8; margin-bottom: 14px; }
.sheet-table { display: flex; flex-direction: column; gap: 1px; background: #2B2B2B; border: 1px solid #2B2B2B; }
.sheet-row { display: grid; grid-template-columns: repeat(var(--units), minmax(0, 1fr)); gap: 1px; background: #2B2B2B; }
.sheet-label {
  background: #fff; color: #C0392B; font-size: 12.5px; font-weight: 600; letter-spacing: .2px;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 6px; line-height: 1.35;
}
.internal-tag { font-size: 8px; background: #EEF2F7; color: #94A3B8; border-radius: 3px; padding: 0 3px; margin-left: 3px; font-weight: 500; }
.sheet-value { background: #fff; position: relative; display: flex; flex-direction: column; justify-content: center; padding: 3px 8px; min-height: 50px; }
.sheet-value:focus-within { background: #FFFDF9; box-shadow: inset 0 0 0 2px rgba(249, 115, 22, .45); z-index: 1; }
.sheet-input {
  width: 100%; border: 0; outline: 0; background: transparent; color: #111; font-size: 14px;
  padding: 7px 3px; line-height: 1.45; font-family: inherit;
}
.sheet-input.center { text-align: center; }
.sheet-input[readonly] { color: #0B2545; font-weight: 700; font-family: var(--mono); font-size: 13.5px; letter-spacing: -.2px; }
.sheet-input::placeholder { color: #C2CBD8; }
.sheet-input.area { resize: none; overflow: hidden; min-height: 28px; }
.sheet-note {
  background: #fff; color: #C0392B; font-size: 10px; line-height: 1.35; text-align: center;
  display: flex; align-items: center; justify-content: center; padding: 5px 5px; letter-spacing: .2px;
}
.note-inline { display: none; color: #C0392B; font-size: 10.5px; margin-top: 2px; }
.sheet-footer { margin-top: 14px; padding-top: 10px; }
.sheet-footer p { margin: 0 0 4px; color: #C0392B; font-size: 10.5px; line-height: 1.65; }

.detail-side { display: flex; flex-direction: column; gap: 12px; }
.side-card { padding: 15px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.side-tip { margin: 0 0 10px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.side-actions { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.money-unit { font-size: 10px; color: var(--muted-2); letter-spacing: .5px; }
.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-field { display: flex; flex-direction: column; gap: 4px; }
.mini-field > span { font-size: 11px; color: var(--muted); }
.money-input { display: flex; align-items: center; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: #FCFDFE; }
.money-input:focus-within { border-color: #F7B183; background: #fff; box-shadow: 0 0 0 3px rgba(249, 115, 22, .08); }
.money-input i { font-style: normal; color: var(--muted-2); font-size: 12px; margin-right: 3px; }
.money-input input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.mini-field .select { width: 100%; }
.balance-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 1px; font-size: 11.5px; color: var(--muted); }
.balance-row b { font-size: 14px; color: var(--orange-2); }

.flow { display: flex; flex-direction: column; }
.flow-step {
  display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 7px 4px; background: transparent;
  border: 0; border-radius: 8px; text-align: left; position: relative; transition: .13s;
}
.flow-step:hover { background: #F7F9FC; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 29px; height: calc(100% - 20px); width: 1px; background: var(--line); }
.flow-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #D8E0EA; background: #fff; color: #94A3B8;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex: none; z-index: 1;
}
.flow-step.done .flow-dot { background: #ECFDF5; border-color: #6EE7B7; color: #059669; }
.flow-step.done:not(:last-child)::after { background: #A7F3D0; }
.flow-step.current .flow-dot { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 0 0 4px rgba(249, 115, 22, .14); }
.flow-mode { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; font-size: 9px; line-height: 15px; vertical-align: 1px; background: #EEF3FA; color: #64748B; font-style: normal; }
.flow-mode.auto { background: #ECFDF5; color: #059669; }
.flow-text { display: flex; flex-direction: column; line-height: 1.3; padding-top: 1px; }
.flow-text b { font-size: 12px; font-weight: 600; color: #64748B; }
.flow-text i { font-style: normal; font-size: 10px; color: var(--muted-2); margin-top: 1px; }
.flow-step.done .flow-text b { color: #059669; }
.flow-step.current .flow-text b { color: var(--text); font-weight: 700; }
.cancelled-banner { margin-top: 8px; background: #FEF2F2; color: #B91C1C; font-size: 11.5px; border-radius: 8px; padding: 8px 10px; display: flex; align-items: center; gap: 6px; }

.share-card .share-link-row { display: flex; gap: 6px; margin-bottom: 8px; }
.share-link-row input {
  flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #F8FAFC;
  padding: 0 9px; font-size: 10.5px; color: #475569; font-family: var(--mono); outline: 0;
}
.share-link-row.empty input { color: var(--muted-2); font-family: var(--font); }
.seg { display: flex; background: #F1F4F8; border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 8px; }
.seg button { flex: 1; height: 28px; border: 0; border-radius: 7px; background: transparent; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.seg button.active { background: #fff; color: var(--navy); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 35, 60, .1); }
.share-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.share-actions .btn { flex: 1; min-width: 76px; }

.att-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 9px; }
.att-item { position: relative; border-radius: 8px; overflow: hidden; background: #F1F4F8; aspect-ratio: 1; }
.att-thumb { display: block; width: 100%; height: 100%; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.att-kind { position: absolute; left: 4px; bottom: 4px; background: rgba(11, 37, 69, .72); color: #fff; font-size: 9px; padding: 1px 5px; border-radius: 4px; }
.att-del {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; border: 0;
  background: rgba(15, 23, 42, .55); color: #fff; display: none; align-items: center; justify-content: center;
}
.att-item:hover .att-del { display: flex; }
.att-empty { font-size: 11px; color: var(--muted-2); padding: 10px 0; text-align: center; }
.upload-row { display: flex; gap: 6px; }
.upload-row .select { flex: 1; }
.upload-label { cursor: pointer; }
.upload-progress { height: 3px; background: #F1F4F8; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }

.log-list { display: flex; flex-direction: column; }
.log-item { display: flex; gap: 8px; padding: 7px 0; }
.log-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; }
.log-body { min-width: 0; }
.log-line { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.log-line b { color: #1E293B; font-weight: 600; }
.log-detail { font-size: 10.5px; color: #475569; margin-top: 2px; word-break: break-word; }
.log-meta { font-size: 10px; color: var(--muted-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.side-card .empty { padding: 16px 0; }

.mobile-savebar { display: none; }
.modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(8, 20, 35, .5); backdrop-filter: blur(3px); animation: fade .18s; }
.modal-card {
  position: relative; background: #fff; border-radius: 16px; width: 520px; max-width: 100%; max-height: 88vh;
  overflow: auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .4); animation: pop .2s ease;
}
.modal-card.sm { width: 380px; }
.modal-card.wide { width: 760px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 4px 18px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line-soft); }
.modal-tip { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 0 0 10px; }
body.modal-open { overflow: hidden; }
.qr-body { text-align: center; }
.qr-body img { width: 236px; height: 236px; margin: 4px auto 10px; border-radius: 8px; border: 1px solid var(--line); }
.qr-body p { font-size: 11px; color: var(--muted); margin: 0; }
.form-error { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; font-size: 11.5px; border-radius: 8px; padding: 8px 10px; margin-top: 8px; white-space: pre-wrap; }

/* =========================================================
   Templates page
   ========================================================= */
.tpl-help { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 16px; background: linear-gradient(180deg, #fff, #FBFCFE); }
.tpl-help-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--orange-soft); color: var(--orange-2); display: flex; align-items: center; justify-content: center; flex: none; }
.tpl-help b { font-size: 12.5px; }
.tpl-help p { margin: 2px 0 0; font-size: 11px; color: var(--muted); line-height: 1.6; }
.tpl-help code { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted-2); background: #F5F8FC; border-radius: 6px; padding: 5px 8px; white-space: nowrap; }
.tpl-list-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tpl-item { overflow: hidden; display: flex; flex-direction: column; }
.tpl-item-preview { position: relative; height: 150px; background: #F8FAFD; border-bottom: 1px solid var(--line-soft); padding: 14px 16px 0; overflow: hidden; }
.tip-title { font-size: 8.5px; font-weight: 700; text-align: center; margin-bottom: 7px; color: #334155; }
.tip-table { display: flex; flex-direction: column; gap: 2px; }
.tip-row { display: flex; gap: 2px; }
.tip-label { font-size: 6px; color: var(--red); border: .5px solid #DCE3EC; background: #fff; text-align: center; padding: 3px 2px; border-radius: 1px; white-space: nowrap; overflow: hidden; }
.tip-fade { position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(180deg, rgba(248, 250, 253, 0), #F8FAFD); }
.tpl-item-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.tpl-item-title { display: flex; align-items: center; gap: 2px; }
.tpl-item-title b { font-size: 13.5px; }
.tpl-item-body p { margin: 0; font-size: 10.5px; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.tpl-item-meta { display: flex; gap: 10px; font-size: 10px; color: var(--muted-2); flex-wrap: wrap; }
.tpl-item-meta span { display: inline-flex; align-items: center; gap: 3px; }
.tpl-add-card {
  border: 1.5px dashed #C9D6E6; border-radius: var(--radius); background: #FAFBFE; min-height: 330px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted); padding: 24px; transition: .16s; font-family: inherit;
}
.tpl-add-card:hover { border-color: var(--orange); background: #FFFCF8; color: var(--orange-2); }
.tpl-add-card b { font-size: 13.5px; color: var(--text); }
.tpl-add-card > span:last-child { font-size: 10.5px; color: var(--muted-2); }
.tpl-add-icon { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; color: var(--muted); }
.tpl-add-card:hover .tpl-add-icon { color: var(--orange-2); border-color: #F7C9A5; }
.tpl-item-actions { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.tpl-item-actions .btn:first-child { flex: 1; min-width: 100px; }
.code-editor {
  width: 100%; min-height: 380px; border: 1px solid var(--line); border-radius: 10px; background: #0F172A; color: #E2E8F0;
  font-family: var(--mono); font-size: 12px; line-height: 1.6; padding: 12px; outline: 0; resize: vertical;
}
.preview-sheet h2 { text-align: center; font-size: 18px; margin: 6px 0 14px; }
.pv-table { display: flex; flex-direction: column; gap: 1px; background: #CBD3DE; border: 1px solid #CBD3DE; }
.pv-row { display: grid; grid-template-columns: repeat(var(--units), minmax(0, 1fr)); gap: 1px; background: #CBD3DE; }
.pv-label { background: #fff; color: var(--red); font-size: 11px; font-weight: 600; padding: 8px 5px; text-align: center; display: flex; align-items: center; justify-content: center; }
.pv-value { background: #fff; font-size: 11px; padding: 8px 9px; color: var(--muted); }
.pv-note { background: #fff; color: var(--red); font-size: 9px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px; }

/* =========================================================
   Logs
   ========================================================= */
.logs-table td { font-size: 12px; }
.log-detail-cell { color: #475569; max-width: 340px; line-height: 1.5; }
.log-detail-cell div { margin-bottom: 2px; }
.action-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 600; background: #EDF1F7; color: #475569; }
.action-tag.act-create { background: #E7F8F0; color: #047857; }
.action-tag.act-update { background: #EAF2FF; color: #1D4ED8; }
.action-tag.act-status { background: #F3EEFF; color: #6D28D9; }
.action-tag.act-share { background: #FFF5E5; color: #B45309; }
.action-tag.act-attachment { background: #E4FAF6; color: #0F766E; }
.action-tag.act-export { background: #EEF0FF; color: #4338CA; }
.action-tag.act-delete { background: #FEF2F2; color: #B91C1C; }
.action-tag.act-template { background: #FAF0FF; color: #9333EA; }
.action-tag.act-login { background: #F1F5F9; color: #64748B; }
.log-card { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; }
.lc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lc-top .muted { font-size: 10.5px; }
.lc-main { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-top: 4px; }
.lc-detail { font-size: 11px; color: #475569; margin-top: 2px; }
.lc-meta { font-size: 10px; color: var(--muted-2); margin-top: 3px; }

/* =========================================================
   Settings
   ========================================================= */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-card { padding: 16px; }
.settings-card.span-2 { grid-column: 1 / -1; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.readonly-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.readonly-row b { color: var(--text); font-weight: 600; }
.data-table.compact td, .data-table.compact th { padding: 9px 10px; }
.data-table.compact td:first-child { display: flex; align-items: center; gap: 6px; }
.inline-form { display: inline; }
.add-member { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.add-member summary { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--orange-2); cursor: pointer; font-weight: 600; list-style: none; }
.add-member summary::-webkit-details-marker { display: none; }
.add-member .form-grid { margin-top: 12px; }
.data-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.data-stats div { background: #F8FAFD; border-radius: 10px; padding: 10px; text-align: center; }
.data-stats b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
.data-stats span { font-size: 10px; color: var(--muted); }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: #FCFDFE; }
.backup-row b { font-size: 12.5px; }
.backup-row p { margin: 2px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.system-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin-top: 12px; }
.system-rows div { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 11.5px; }
.system-rows span { color: var(--muted); }
.system-rows b { font-weight: 600; }

/* =========================================================
   Empty / toast
   ========================================================= */
.empty { text-align: center; padding: 38px 16px; color: var(--muted); }
.empty.sm { padding: 20px 10px; }
.empty-icon { width: 52px; height: 52px; border-radius: 50%; background: #F3F6FA; color: #A9B6C8; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.empty b { display: block; font-size: 13.5px; color: #334155; margin-bottom: 3px; }
.empty p { margin: 0 0 12px; font-size: 11.5px; }

.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px; background: #0F172A; color: #fff; font-size: 12.5px;
  padding: 10px 14px; border-radius: 10px; box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .45);
  animation: toastIn .2s ease; max-width: 340px; pointer-events: auto;
}
.toast.success { background: #065F46; }
.toast.error { background: #991B1B; }
.toast.warn { background: #92400E; }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* =========================================================
   Login
   ========================================================= */
.login-body { background: #F6F7FB; min-height: 100vh; }
.login-shell { display: grid; grid-template-columns: 1.08fr 1fr; min-height: 100vh; }
.login-visual {
  position: relative; overflow: hidden; color: #fff; padding: 46px 52px;
  background: radial-gradient(120% 120% at 85% 10%, #1B4A75 0%, #0B2545 52%, #07182C 100%);
  display: flex; align-items: center;
}
.lv-grid {
  position: absolute; inset: 0; opacity: .55;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(80% 80% at 30% 40%, #000 20%, transparent 100%);
}
.lv-content { position: relative; z-index: 2; max-width: 470px; }
.lv-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 46px; }
.lv-brand div { display: flex; flex-direction: column; }
.lv-brand b { font-size: 18px; letter-spacing: 3px; }
.lv-brand span { font-size: 8.5px; letter-spacing: 3px; color: rgba(255, 255, 255, .45); margin-top: 3px; }
.login-visual h1 { font-size: 38px; line-height: 1.35; margin: 0 0 16px; letter-spacing: 1px; font-weight: 700; }
.lv-sub { font-size: 13px; line-height: 1.85; color: rgba(255, 255, 255, .58); margin: 0 0 32px; max-width: 400px; }
.lv-points { display: flex; flex-direction: column; gap: 14px; }
.lv-point { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: rgba(255, 255, 255, .62); }
.lv-point svg { color: #FDBA74; margin-top: 1px; }
.lv-point b { color: #fff; font-weight: 600; margin-right: 5px; }
.lv-route { display: flex; align-items: center; gap: 0; margin-top: 54px; opacity: .8; }
.lv-dot { width: 8px; height: 8px; border-radius: 50%; background: #FDBA74; box-shadow: 0 0 0 4px rgba(253, 186, 116, .18); }
.lv-line { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 6px, transparent 6px 12px); margin: 0 8px; max-width: 280px; }
.lv-truck { color: #fff; opacity: .85; }

.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; position: relative; }
.login-card { width: 100%; max-width: 360px; }
.login-mobile-brand { display: none; align-items: center; gap: 9px; margin-bottom: 26px; }
.login-mobile-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.login-mobile-brand b { font-size: 16px; letter-spacing: 2px; }
.login-mobile-brand i { font-style: normal; font-size: 9px; color: var(--muted-2); letter-spacing: 2px; }
.login-card h2 { font-size: 27px; margin: 0 0 6px; letter-spacing: -.5px; }
.login-tip { font-size: 12.5px; color: var(--muted); margin: 0 0 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.input-wrap {
  display: flex; align-items: center; gap: 8px; height: 46px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; padding: 0 12px; color: var(--muted-2); transition: .15s;
}
.input-wrap:focus-within { border-color: #F7B183; box-shadow: 0 0 0 3px rgba(249, 115, 22, .1); }
.input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; font-size: 14px; color: var(--text); }
.login-form .btn { margin-top: 6px; }
.alert { display: flex; align-items: center; gap: 7px; border-radius: 9px; padding: 9px 11px; font-size: 12px; margin-bottom: 14px; }
.alert-error { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; }
.login-foot { margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted-2); display: flex; align-items: center; gap: 5px; line-height: 1.6; }
.login-copy { position: absolute; bottom: 16px; font-size: 10px; color: var(--muted-2); }

/* Error page */
.error-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.error-card { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 36px 34px; max-width: 420px; box-shadow: var(--shadow); }
.error-card .brand-mark { margin: 0 auto 14px; }
.error-card h1 { font-size: 42px; margin: 0; letter-spacing: -1px; color: var(--navy); }
.error-card p { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 8px 0 20px; }
.error-actions { display: flex; gap: 8px; justify-content: center; }

/* =========================================================
   Bottom nav
   ========================================================= */
.bottom-nav { display: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
  .tpl-list-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .gsearch-box { width: 230px; }
}

@media (max-width: 1024px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: center;
  }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 9.5px; color: #93A1B5; padding: 2px 0; }
  .bn-item.active { color: var(--navy); font-weight: 600; }
  .bn-item.active svg { color: var(--orange); }
  /* 统一图标槽位：四个入口的图标与文字共用同一基线，圆按钮不再上浮 */
  .bn-ico { width: 100%; height: 34px; display: flex; align-items: center; justify-content: center; }
  .bn-fab { position: static; }
  .bn-fab .fab {
    width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #F97316, #EA580C); color: #fff;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 12px -6px rgba(249, 115, 22, .75);
    border: 0;
  }
  .bn-fab .fab svg { width: 20px; height: 20px; margin: 0; }
  .bn-fab span:last-child { margin-top: 0; }
  .content { padding: 18px 18px 96px; }
  .topbar { padding: 0 18px; }
  .mobile-brand { display: inline-flex; }
  .page-title { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .detail-side .side-card:first-child { grid-column: 1 / -1; }
  .new-layout { grid-template-columns: 1fr; }
  .new-side { position: static; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card.span-2 { grid-column: auto; }
  .mobile-savebar {
    display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0;
    bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 85;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 8px 14px; box-shadow: 0 -6px 20px -14px rgba(15, 35, 60, .3);
  }
  .ms-state { flex: 1; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .page-order-detail .content { padding-bottom: 86px; }
  .page-order-detail .bottom-nav { display: none; }
  .page-order-detail .mobile-savebar { bottom: 0; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { background: radial-gradient(120% 60% at 50% 0%, #EAF0F8 0%, #F6F7FB 60%); }
  .login-mobile-brand { display: flex; }
}

@media (max-width: 820px) {
  .hide-md { display: none !important; }
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl-list-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .data-stats { grid-template-columns: repeat(3, 1fr); }
  .system-rows { grid-template-columns: 1fr; }
  .detail-side { grid-template-columns: 1fr; }
  .data-table td, .data-table th { padding: 9px 10px; }
}

@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .content { padding: 14px 13px 96px; }
  .topbar { height: 58px; padding: 0 13px; gap: 8px; }
  .gsearch { flex: 1; }
  .gsearch-box { width: 100%; height: 36px; }
  .gsearch-box kbd { display: none; }
  .gsearch-panel { width: calc(100vw - 26px); right: -46px; }
  .topbar-new span { display: none; }
  .topbar-new { width: 36px; padding: 0; }
  .topbar-avatar { width: 32px; height: 32px; font-size: 13px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .page-head h1 { font-size: 21px; }
  .head-actions { justify-content: flex-start; }
  .head-actions .btn { flex: 1; }
  .order-head .head-actions { flex-wrap: nowrap; }
  .order-head .head-actions .btn { flex: none; }
  .order-head .title-line h1 { font-size: 23px; }
  .hero { padding: 20px 18px; border-radius: 16px; }
  .hero-copy h2 { font-size: 18px; }
  .hero-copy p { font-size: 11.5px; margin-bottom: 12px; }
  .hero-art { display: none; }
  .hero-search { padding: 4px 4px 4px 12px; }
  .hero-search input { height: 36px; font-size: 13px; }
  .hero-search .btn { height: 36px; padding: 0 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 12px; gap: 9px; border-radius: 12px; }
  .stat-icon { width: 32px; height: 32px; border-radius: 9px; }
  .stat-body b { font-size: 19px; }
  .stat-body i { font-size: 9.5px; }
  .card { border-radius: 12px; }
  .card-head { padding: 13px 14px 10px; }
  .filter-bar { padding: 9px; }
  .filter-form { gap: 6px; }
  .search-inline { flex: 1 1 100%; }
  .filter-form .select { flex: 1; min-width: 0; }
  .status-tabs { margin: 0 -13px 10px; padding: 0 13px 2px; }
  .orders-table { display: none; }
  .mobile-cards { display: flex; flex-direction: column; }
  .list-card { background: transparent; border: 0; box-shadow: none; }
  .list-card .table-scroll { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
  .logs-table { display: none; }
  .pagination { border-top: 0; padding: 10px 0 0; }
  .tpl-card { padding: 10px; }
  .tpl-thumb { width: 88px; min-height: 100px; }
  .tpl-info p { -webkit-line-clamp: 2; }
  .sheet-wrap { padding: 10px; }
  .sheet { padding: 14px 10px 12px; border-width: 1px; }
  .sheet-title { font-size: 17px; letter-spacing: 1px; }
  .sheet-sub { font-size: 7px; letter-spacing: 1.6px; margin-bottom: 9px; }
  .sheet-table { gap: 1px; }
  .sheet-row { display: block; }
  .sheet-label {
    justify-content: flex-start; text-align: left; background: #FAFBFD; padding: 5px 10px 4px;
    font-size: 10.5px; letter-spacing: .3px; border-bottom: 1px solid #E7EBF1;
  }
  .sheet-value { padding: 1px 10px 6px; min-height: 0; }
  .sheet-input { font-size: 14.5px; padding: 7px 2px; }
  .sheet-input.area { min-height: 30px; }
  .sheet-note { display: none; }
  .note-inline { display: block; padding-bottom: 3px; }
  .sheet-footer { margin-top: 10px; padding-top: 8px; }
  .sheet-footer p { font-size: 9.5px; }
  .sheet-toolbar { padding: 8px 11px; }
  .sheet-legend { display: none; }
  .order-actions .presence { display: none; }
  .order-actions .dropdown > .btn span { display: none; }
  .detail-side { gap: 10px; }
  .side-card { padding: 13px; }
  .mobile-savebar .btn { flex: none; }
  .modal-card { border-radius: 14px; }
  .modal-card.wide { width: 100%; }
  .qr-body img { width: 200px; height: 200px; }
  .login-panel { padding: 24px 22px 44px; justify-content: flex-start; padding-top: 12vh; }
  .login-card h2 { font-size: 24px; }
  .backup-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .data-stats { grid-template-columns: repeat(2, 1fr); }
  .tpl-help code { display: none; }
  .toast-wrap { left: 12px; right: 12px; top: 12px; }
  .toast { max-width: none; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-body b { font-size: 17px; }
  .tpl-thumb { display: none; }
  .tpl-card { padding: 12px; }
}

/* 详情页 · 卡车经纪人询价卡片（成本价仅平台可见） */
.broker-card { grid-column: 1 / -1; }
.broker-cost {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 2px 0 10px; padding: 11px 13px; border-radius: 10px;
  background: linear-gradient(120deg, #FFF8EF, #FFFFFF 70%); border: 1px solid #FBE3C6;
}
.broker-cost > span { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: #9A6B32; }
.broker-cost i { font-style: normal; font-size: 9.5px; color: var(--muted-2); }
.broker-cost b { font-size: 20px; color: var(--orange-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.broker-cost.empty { background: #F5F7FA; border-color: var(--line); }
.broker-cost.empty > span { color: var(--muted); }
.broker-cost.empty b { font-size: 13px; color: var(--muted); }
.broker-publish { margin-top: 12px; padding: 11px 12px; border-radius: 10px; background: #F0F7FF; border: 1px solid #CFE3FB; }
.broker-publish p { margin: 0 0 9px; font-size: 11px; color: #3B5B80; line-height: 1.6; }
.broker-publish.done { background: #F0FDF6; border-color: #A7F3D0; color: #059669; font-size: 11.5px; font-weight: 600; text-align: center; }
