/* 小飞机物流内部系统 · 视觉：深色侧栏 + 浅灰工作区 + 白卡片。只覆盖 Bootstrap 5 的默认，不改结构。 */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e5e8ef;
  --border-strong: #d5dae4;
  --text: #1f2937;
  --text-2: #4b5563;
  --muted: #6b7280;
  --primary: #2f6fed;
  --primary-hover: #245cd0;
  --primary-soft: #eaf1ff;
  --success: #15803d; --success-soft: #e6f6ec;
  --warning: #b45309; --warning-soft: #fff3df;
  --danger: #b91c1c;  --danger-soft: #fde8e8;
  --neutral-soft: #eef1f6;
  --sidebar-bg: #111a2b;
  --sidebar-text: #aab6c8;
  --sidebar-active: #ffffff;
  --sidebar-w: 236px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bs-primary: #2f6fed;
  --bs-primary-rgb: 47, 111, 237;
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 14px;
  --bs-body-color: #1f2937;
  --bs-body-bg: #f4f6fa;
  --bs-border-color: #e5e8ef;
  --bs-link-color: #2f6fed;
  --bs-link-hover-color: #245cd0;
}
html, body { height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }

/* ---------- 壳子：侧栏 + 内容区 ---------- */
body.has-sidebar { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; }
.brand:hover { text-decoration: none; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #6366f1); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-mark .ico { width: 20px; height: 20px; color: #fff; }
.brand-name { display: block; font-weight: 600; font-size: 14px; line-height: 1.2; }
.brand-sub { display: block; font-size: 11px; color: var(--sidebar-text); margin-top: 2px; }
.nav-groups { padding: 4px 10px; flex: 1; }
.nav-group { margin-bottom: 10px; }
.nav-group-title { font-size: 11px; letter-spacing: .08em; color: #6c7a90; padding: 10px 10px 4px; text-transform: uppercase; }
.nav-item-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-size: 13.5px; margin: 1px 0; position: relative; }
.nav-item-link .ico { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item-link.active { background: rgba(59, 130, 246, .18); color: var(--sidebar-active); font-weight: 500; }
.nav-item-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #60a5fa; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2f6fed; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.who { flex: 1; min-width: 0; }
.who-name { color: #fff; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { font-size: 11px; color: #6c7a90; }
.icon-btn { color: var(--sidebar-text); padding: 4px; border-radius: 6px; display: inline-flex; }
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.sidebar-toggle { display: none; }
.content { padding: 22px 28px 40px; min-width: 0; }
@media (max-width: 900px) {
  body.has-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s; z-index: 1040; }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-toggle { display: block; position: fixed; left: 12px; top: 10px; z-index: 1050; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 16px; }
  .content { padding: 54px 16px 32px; }
}

/* ---------- 页面标题 ---------- */
main h4 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
main h4 small, main h4 .fs-6 { font-size: 12.5px !important; font-weight: 400; color: var(--muted) !important; }
main .d-flex > h4 { margin-bottom: 0; }
main .d-flex.mb-2 { margin-bottom: 14px !important; }
main h5.modal-title { font-size: 15px; font-weight: 600; }

/* ---------- 卡片 ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; padding: 10px 14px; }
.card-header .text-muted { font-weight: 400; }
.card-body { padding: 14px; }
.card-body dl.row dt { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.card-body dl.row dd { margin-bottom: 6px; }
details.card summary.card-header { cursor: pointer; list-style: none; }
details.card summary.card-header::before { content: "▸ "; color: var(--muted); }
details[open].card summary.card-header::before { content: "▾ "; }
details.card:not([open]) summary.card-header { border-bottom: 0; }

/* ---------- 筛选条 ---------- */
main > form.row, main form.row.g-2 { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0 0 14px; box-shadow: var(--shadow); }
main form.row.g-2 > [class*="col-"] { padding-top: 6px; }
main form.row.g-2 .col-12.text-muted { padding-top: 4px; }

/* ---------- 表单控件 ---------- */
.form-control, .form-select { border-color: var(--border-strong); border-radius: 7px; color: var(--text); }
.form-control-sm, .form-select-sm { min-height: 32px; font-size: 13px; padding: 4px 10px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .15); }
.form-control::placeholder { color: #9ca3af; }
.form-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.form-text { font-size: 12px; }
label.small input[type="checkbox"], label.me-3 input[type="checkbox"], label input[type="radio"] { accent-color: var(--primary); margin-right: 3px; }
textarea.form-control { font-family: var(--mono); font-size: 12.5px; }

/* ---------- 按钮 ---------- */
.btn { border-radius: 7px; font-weight: 500; }
.btn-sm { font-size: 13px; padding: 5px 12px; min-height: 32px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline-secondary { color: var(--text-2); border-color: var(--border-strong); background: var(--surface); }
.btn-outline-secondary:hover { background: var(--neutral-soft); color: var(--text); border-color: var(--border-strong); }
.btn-outline-secondary:disabled { opacity: .55; }
.btn-outline-danger { border-color: #f3b4b4; color: var(--danger); }
.btn-link { padding: 0; }

/* ---------- 表格 ---------- */
.table-responsive { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-responsive > .table { margin-bottom: 0; }
main > .table, main > .row .table, .card .table { background: var(--surface); }
main > .table { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table { --bs-table-striped-bg: #fafbfd; --bs-table-hover-bg: #f2f6ff; font-size: 13px; color: var(--text); }
.table > thead > tr > th { background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; border-bottom: 1px solid var(--border); padding: 9px 10px; white-space: nowrap; }
.table > tbody > tr > td { padding: 7px 10px; border-color: #eef1f6; vertical-align: middle; }
table.table-sm td, table.table-sm th { white-space: nowrap; }
.table .text-truncate { white-space: nowrap; }
.table-danger { --bs-table-bg: #fff1f1; --bs-table-striped-bg: #fdecec; --bs-table-hover-bg: #fbe1e1; }
.table-light { --bs-table-bg: #f9fafb; }

/* 备案列表：把最后一列（操作）固定在右侧，横向滚动时始终可见（2026-09-22 老板要求） */
.gb-list th:last-child, .gb-list td:last-child { position: sticky; right: 0; z-index: 2; box-shadow: -8px 0 10px -8px rgba(16, 24, 40, .18); }
.gb-list thead th:last-child { background: #f8fafc; }
.gb-list tbody td:last-child { background: #fff; }
.gb-list.table-striped > tbody > tr:nth-of-type(odd) > td:last-child { background: #fafbfd; }
.gb-list > tbody > tr:hover > td:last-child { background: #f2f6ff; }

.text-muted.small.mb-1 { color: var(--muted) !important; margin-bottom: 8px !important; }
#table.is-loading { opacity: .55; transition: opacity .15s; }

/* ---------- 徽章 / 状态 ---------- */
.badge { border-radius: 999px; font-weight: 500; font-size: 11.5px; padding: 3px 9px; }
.badge.text-bg-success { background: var(--success-soft) !important; color: var(--success) !important; }
.badge.text-bg-secondary { background: var(--neutral-soft) !important; color: var(--text-2) !important; }
.badge.text-bg-warning { background: var(--warning-soft) !important; color: var(--warning) !important; }
.badge.text-bg-danger { background: var(--danger-soft) !important; color: var(--danger) !important; }
.badge.text-bg-light { background: var(--neutral-soft) !important; color: var(--muted) !important; }
.badge.text-bg-dark { background: #1f2937 !important; color: #fff !important; }

/* ---------- 提示 ---------- */
.alert { border-radius: 8px; border: 1px solid transparent; font-size: 13px; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: #f5c2c2; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: #f7dfb5; }
.alert-info { background: var(--primary-soft); color: #1e4fb8; border-color: #c9dbff; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #bde5cb; }

/* ---------- 分页 ---------- */
.pagination { margin: 12px 0 0; gap: 4px; }
.page-link { border-radius: 6px !important; border-color: var(--border); color: var(--text-2); font-size: 13px; padding: 4px 10px; }
.page-item.disabled .page-link { background: transparent; color: #9ca3af; }
.page-link:hover { background: var(--primary-soft); color: var(--primary); }

/* ---------- 标签页（打单/订单查询、系统管理） ---------- */
.nav-pills { gap: 2px; background: var(--neutral-soft); padding: 3px; border-radius: 8px; }
.nav-pills .nav-link { border-radius: 6px; color: var(--text-2); font-size: 13px; padding: 4px 12px; }
.nav-pills .nav-link.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 500; }
.nav-pills .nav-link:hover { text-decoration: none; }

/* ---------- 弹窗 ---------- */
.modal-content { border: 0; border-radius: 12px; box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
.modal-header { border-bottom: 1px solid var(--border); padding: 14px 18px; }
.modal-body { padding: 16px 18px; }
.modal-body dl.row dt { color: var(--muted); font-weight: 500; }

/* ---------- 看板 ---------- */
.stat-card { display: block; height: 100%; }
.stat-card .card { transition: transform .12s, box-shadow .12s; }
.stat-card:hover { text-decoration: none; }
.stat-card:hover .card { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16, 24, 40, .08); }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--text); margin: 2px 0; font-variant-numeric: tabular-nums; }
.stat-value.neg { color: var(--danger); }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-accent { width: 32px; height: 4px; border-radius: 2px; background: var(--primary); margin-bottom: 10px; }
.stat-accent.warn { background: #f59e0b; } .stat-accent.ok { background: #22c55e; } .stat-accent.info { background: #06b6d4; } .stat-accent.violet { background: #8b5cf6; }

/* ---------- 登录页 ---------- */
body.login-page { background: radial-gradient(1200px 600px at 10% -10%, #dbe7ff 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #e9e5ff 0%, transparent 55%), var(--bg); }
body.login-page .content { padding: 0; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 30px 30px 22px; box-shadow: 0 12px 40px rgba(16, 24, 40, .10); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-title { font-size: 17px; font-weight: 600; }
.login-sub { font-size: 12.5px; color: var(--muted); }
.login-card .form-control-lg { font-size: 14px; min-height: 42px; }
.login-card .btn-lg { font-size: 14px; min-height: 42px; }
.login-foot { font-size: 12px; color: var(--muted); margin-top: 16px; text-align: center; }

/* ---------- 工具条（打单记录：额度 + 按钮） ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.quota-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.quota-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; display: flex; align-items: baseline; gap: 8px; box-shadow: var(--shadow); }
.quota-label { font-size: 12px; color: var(--muted); }
.quota-value { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.quota-value.neg { color: var(--danger); }
.toolbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar-actions .btn { white-space: nowrap; }

/* ---------- 小件 ---------- */
main p.text-muted.small { font-size: 12.5px; }
.text-break.small { word-break: break-all; }
.link-plain { color: inherit; }
h4 + .nav-pills, .d-flex > .nav-pills { margin-left: auto; }

/* ---------- 2026-09-30 易用性：查单框 / 折叠菜单 / 提示 / 确认框 / 复制 ---------- */
.quick-find { margin: 0 12px 6px; position: relative; display: flex; align-items: center; }
.quick-find .ico { position: absolute; left: 9px; width: 15px; height: 15px; color: #7d8aa0; }
.quick-find input { width: 100%; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10); color: #fff; border-radius: 8px; padding: 7px 28px 7px 30px; font-size: 13px; outline: none; }
.quick-find input::placeholder { color: #7d8aa0; }
.quick-find input:focus { border-color: #60a5fa; background: rgba(255,255,255,.12); }
.quick-find kbd { position: absolute; right: 8px; background: rgba(255,255,255,.1); color: #9fb0c8; font-size: 11px; padding: 0 5px; border-radius: 4px; box-shadow: none; }
.nav-group.folded .nav-item-link { display: none; }
.nav-group [role="button"] { cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; }
.fold-caret { transition: transform .15s; font-size: 10px; }
.nav-group.folded .fold-caret { transform: rotate(-90deg); }
.nav-group-title { padding-top: 6px; }
.nav-group { margin-bottom: 4px; }

.toast-stack { position: fixed; top: 16px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.bo-toast { display: flex; align-items: flex-start; gap: 10px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--success); border-radius: 10px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(16,24,40,.16); font-size: 13.5px; animation: toastIn .18s ease-out; }
.bo-toast.danger { border-left-color: var(--danger); }
.bo-toast-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.bo-toast.danger .bo-toast-icon { background: var(--danger-soft); color: var(--danger); }
.bo-toast-text { flex: 1; white-space: pre-line; word-break: break-word; }
.bo-toast button { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
.bo-toast.fade-out { opacity: 0; transform: translateY(-6px); transition: all .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

#confirmModal .modal-body { padding: 22px 22px 10px; }
.confirm-title { font-size: 15.5px; font-weight: 600; margin-bottom: 6px; }
.confirm-text { color: var(--text-2); white-space: pre-line; font-size: 13.5px; }
#confirmModal .modal-footer { border-top: 0; padding: 8px 22px 18px; }

td.mono, span.mono, div.mono, .copy { cursor: copy; }
.copied { background: var(--success-soft) !important; color: var(--success) !important; border-radius: 4px; transition: background .2s; }
.table-responsive { max-height: none; }
.table > thead > tr > th { position: sticky; top: 0; z-index: 1; }

/* 状态标签 */
.st { display: inline-block; border-radius: 999px; font-size: 11.5px; padding: 1px 8px; font-weight: 500; white-space: nowrap; }
.st-none { background: var(--neutral-soft); color: var(--muted); }
.st-num { background: var(--primary-soft); color: #1e4fb8; }
.st-printed { background: var(--success-soft); color: var(--success); }
.st-void { background: var(--danger-soft); color: var(--danger); }
.st-warn { background: var(--warning-soft); color: var(--warning); }

/* 勾选后浮在底部的操作条 */
.pick-bar { position: sticky; bottom: 12px; z-index: 20; margin-top: 12px; background: #111a2b; color: #fff; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; box-shadow: 0 12px 30px rgba(16,24,40,.25); }
.pick-bar .n { font-weight: 600; margin-right: 6px; }
.pick-bar .btn { min-height: 30px; }
.pick-bar .btn-light { background: #fff; }
.pick-bar .btn-ghost { color: #cbd5e1; border: 1px solid rgba(255,255,255,.2); background: transparent; }
.pick-bar .btn-ghost:hover { color: #fff; background: rgba(255,255,255,.08); }
tr.picked > td { background: #eef4ff !important; }
tr.row-link { cursor: pointer; }

/* 页面头：标题 + 状态 + 右侧主操作 */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h4 { margin: 0; }
.page-head .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 18px; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-size: 14px; margin-top: 2px; word-break: break-all; }
.fact.wide { grid-column: span 2; }
.step { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; align-items: center; justify-content: center; margin-right: 6px; }
.step.done { background: var(--success); }
.save-bar { position: sticky; bottom: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--border); margin: 16px -28px -40px; padding: 12px 28px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.save-bar .todo { color: var(--warning); font-size: 13px; }
.save-bar .ready { color: var(--success); font-size: 13px; }
.page-head h4 .mono { font-size: 18px; font-weight: 600; }
.page-head h4 .st { font-size: 12px; }
