/* ===== 货运后台 · 商务高级主题 =====
   配色：深海军蓝 #0f1d33 / #14233b · 香槟金 #c2a25f / #d8bd86 · 浅雾底 #eef1f6 */
:root {
  --navy-900: #0c1726;
  --navy-800: #0f1d33;
  --navy-700: #14233b;
  --navy-600: #1d3149;
  --gold: #c2a25f;
  --gold-soft: #d8bd86;
  --gold-bg: #f7efdc;
  --ink: #1d2837;
  --muted: #7b8794;
  --line: #e7ebf1;
  --bg: #eef1f6;
  --card: #ffffff;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15,29,51,.06), 0 1px 2px rgba(15,29,51,.04);
  --shadow-md: 0 8px 24px rgba(15,29,51,.08);
  --shadow-lg: 0 24px 60px rgba(12,23,38,.28);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
button {
  cursor: pointer; border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 14px; background: #fff; color: #455261;
  font-size: 13px; margin-right: 8px; font-weight: 500;
  transition: all .18s ease;
}
button:hover { border-color: #cfd6e0; background: #f7f9fc; }
button.primary {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(20,35,59,.25);
}
button.primary:hover { filter: brightness(1.12); }
button.danger { background: #fff; color: #d4493f; border-color: #f3cfcc; }
button.danger:hover { background: #fdf2f1; }
input, select {
  width: 100%; padding: 9px 12px; border: 1px solid #d7deea; border-radius: 9px;
  font-size: 14px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(194,162,95,.16); }

/* ===== 登录页 ===== */
.login-wrap { display: flex; min-height: 100vh; }
.login-aside {
  flex: 1.05; position: relative; color: #f3ead6; overflow: hidden;
  background:
    radial-gradient(1200px 500px at -10% -10%, rgba(194,162,95,.18), transparent 60%),
    linear-gradient(150deg, var(--navy-900), var(--navy-700) 55%, #1a2c47);
  display: flex; align-items: center; justify-content: center;
}
.login-aside::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(194,162,95,.22), transparent 70%);
}
.login-aside-inner { position: relative; z-index: 1; max-width: 440px; padding: 48px; }
.login-logo {
  width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: var(--navy-800);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 10px 30px rgba(194,162,95,.35); margin-bottom: 26px;
}
.logo-tire { width: 78%; height: 78%; display: block; }
.login-aside h1 { font-size: 30px; font-weight: 700; letter-spacing: .5px; margin-bottom: 16px; color: #fff; }
.login-aside p { font-size: 15px; line-height: 1.9; color: #c7d0de; }
.login-feat { list-style: none; margin-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.login-feat li { position: relative; padding-left: 26px; font-size: 14px; color: #dde4ee; }
.login-feat li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold)); box-shadow: 0 0 0 4px rgba(194,162,95,.15);
}
.login-main { flex: .95; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; position: relative; }
.login-card { width: 360px; padding: 8px; }
.login-brand-mini { font-size: 13px; letter-spacing: 3px; color: var(--gold); font-weight: 700; margin-bottom: 18px; text-transform: uppercase; }
.login-card h2 { font-size: 26px; font-weight: 700; color: var(--navy-800); }
.login-sub { font-size: 13px; color: var(--muted); margin: 8px 0 28px; }
.login-field { display: block; margin-bottom: 18px; }
.login-field span { display: block; font-size: 12px; color: #6b7686; margin-bottom: 7px; font-weight: 600; }
.login-field input { padding: 11px 14px; }
.login-card button {
  width: 100%; margin: 8px 0 0; padding: 12px; font-size: 15px; letter-spacing: 4px; font-weight: 600;
  color: #fff; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  box-shadow: 0 10px 26px rgba(20,35,59,.28);
}
.login-card button:hover { filter: brightness(1.12); }
.err { color: #d4493f; margin-top: 12px; font-size: 13px; text-align: center; }
.login-hint { margin-top: 18px; font-size: 12px; color: #9aa4b2; line-height: 1.7; }
.login-foot { position: absolute; bottom: 22px; font-size: 12px; color: #b7c0cd; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.topbar { display: none; }
.sidebar-overlay { display: none; }
.head-actions { display: flex; gap: 0; flex-wrap: wrap; }
.sidebar {
  width: 234px; color: #c8d2e0; display: flex; flex-direction: column; padding: 22px 0 18px;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-700));
  border-right: 1px solid rgba(255,255,255,.04);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 22px 26px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: var(--navy-800);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold)); box-shadow: 0 6px 16px rgba(194,162,95,.32);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 16px; font-weight: 700; color: #fff; }
.brand-text small { font-size: 10px; letter-spacing: 2px; color: var(--gold); font-weight: 600; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 6px 14px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer;
  color: #aeb9c9; font-size: 14px; border-radius: 10px; transition: all .16s ease; position: relative;
}
.sidebar nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar nav a.active {
  background: linear-gradient(135deg, rgba(194,162,95,.18), rgba(194,162,95,.06));
  color: #fff; font-weight: 600;
}
.sidebar nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--gold-soft), var(--gold));
}
.ic { width: 18px; height: 18px; flex: none; opacity: .9; background: currentColor;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.ic-dash { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/></svg>"); }
.ic-deli { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 4h13v9H3zM16 8h4l2 3v4h-6zM6.5 17a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm11 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 4h13v9H3zM16 8h4l2 3v4h-6zM6.5 17a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm11 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/></svg>"); }
.ic-order { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 2h9l5 5v15H6zM14 3v5h5'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 2h9l5 5v15H6zM14 3v5h5'/></svg>"); }
.ic-cust { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0 2c-5 0-9 2.5-9 6v2h18v-2c0-3.5-4-6-9-6z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0 2c-5 0-9 2.5-9 6v2h18v-2c0-3.5-4-6-9-6z'/></svg>"); }
.ic-driver { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 11l1.5-4.5A2 2 0 0 1 8.4 5h7.2a2 2 0 0 1 1.9 1.5L19 11v7h-3v-2H8v2H5zm2.5 4a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm9 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 11l1.5-4.5A2 2 0 0 1 8.4 5h7.2a2 2 0 0 1 1.9 1.5L19 11v7h-3v-2H8v2H5zm2.5 4a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm9 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/></svg>"); }
.ic-admin { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l8 3v6c0 5-3.4 9.2-8 11-4.6-1.8-8-6-8-11V5l8-3z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l8 3v6c0 5-3.4 9.2-8 11-4.6-1.8-8-6-8-11V5l8-3z'/></svg>"); }
.side-foot { padding: 14px 18px 0; border-top: 1px solid rgba(255,255,255,.06); margin: 8px 14px 0; }
.who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.who-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--navy-800);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
}
.who-meta { display: flex; flex-direction: column; line-height: 1.3; }
.who-meta b { font-size: 13px; color: #eef2f8; font-weight: 600; }
.who-meta small { font-size: 11px; color: #8693a6; }
.side-actions { display: flex; gap: 8px; }
.side-actions button { flex: 1; margin: 0; }
.pwd-btn { background: rgba(194,162,95,.14); color: var(--gold-soft); border: 1px solid rgba(194,162,95,.28); }
.pwd-btn:hover { background: rgba(194,162,95,.24); border-color: rgba(194,162,95,.4); }
.logout { width: 100%; background: rgba(255,255,255,.06); color: #d6deea; border: 1px solid rgba(255,255,255,.08); margin: 0; }
.logout:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.14); }

/* ===== 内容区 ===== */
.content { flex: 1; padding: 30px 34px; overflow: auto; }
.head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.head h3 { font-size: 21px; font-weight: 700; color: var(--navy-800); position: relative; padding-left: 14px; }
.head h3::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 3px; background: linear-gradient(var(--gold-soft), var(--gold)); }

/* 分段切换 */
.seg { display: inline-flex; background: #e4e9f1; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.seg a { padding: 7px 18px; font-size: 13px; color: #6b7686; border-radius: 7px; cursor: pointer; transition: all .15s; }
.seg a.on { background: #fff; color: var(--navy-800); font-weight: 600; box-shadow: var(--shadow-sm); }

/* 配送记录块 */
.driver-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.driver-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.driver-head b { color: var(--navy-800); }
.driver-stat { font-size: 13px; color: var(--muted); }
.driver-stat b { color: var(--gold); }
.driver-block table { box-shadow: none; border: 1px solid var(--line); }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
th, td { text-align: left; padding: 13px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
th { background: #f6f8fb; color: #6b7686; font-weight: 600; font-size: 12px; letter-spacing: .3px; text-transform: none; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: #faf7ef; }
tbody tr:last-child td { border-bottom: none; }
td b { color: var(--navy-800); }
.muted { color: var(--muted); }
.empty { text-align: center; color: #aab3c0; padding: 36px; }
.badge { background: var(--gold-bg); color: #9a7b2e; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid #ecdcb6; display: inline-block; }
/* 状态配色：待接单(灰) 已接单(蓝) 已取货(青) 运输中(金) 已到达(紫) 已签收(绿) */
.badge.st-pending { background: #eef1f6; color: #5b6776; border-color: #dde3ec; }
.badge.st-accepted { background: #e8f1ff; color: #1f6fd6; border-color: #c7defb; }
.badge.st-picked { background: #e2f7f4; color: #0f9488; border-color: #bfeae3; }
.badge.st-transit { background: #fff3d8; color: #b9821a; border-color: #f4dfa6; }
.badge.st-arrived { background: #efe9ff; color: #6b46d6; border-color: #ddd2f7; }
.badge.st-signed { background: #e4f7ea; color: #1f9d57; border-color: #c2ead0; }
.pwd { font-family: ui-monospace, Menlo, Consolas, monospace; background: #eef1f6; color: var(--navy-800); padding: 2px 8px; border-radius: 6px; font-size: 13px; letter-spacing: 1px; }

/* ===== 仪表盘 KPI ===== */
.kpi-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 8px; }
.kpi-card {
  position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: rgba(20,35,59,.04); }
.kpi-card.gold { background: linear-gradient(135deg, #fffaf0, #f9efd6); border-color: #efe1bf; }
.kpi-card.gold::after { background: rgba(194,162,95,.14); }
.kpi-card.green { background: linear-gradient(135deg, #f1faf4, #ddf2e6); border-color: #c8e8d3; }
.kpi-card.green::after { background: rgba(34,153,84,.12); }
.kpi-label { font-size: 13px; color: var(--muted); position: relative; z-index: 1; }
.kpi-value { font-size: 34px; font-weight: 800; color: var(--navy-800); margin-top: 10px; position: relative; z-index: 1; letter-spacing: -.5px; }
.kpi-unit { font-size: 15px; font-weight: 600; color: #a7b0bd; }
.sub-title { margin: 28px 0 14px; font-size: 16px; font-weight: 700; color: var(--navy-800); }
@media (max-width: 768px) { .kpi-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(12,23,38,.5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 16px; padding: 26px 28px; width: 560px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal.small { width: 380px; }
.modal h3 { margin-bottom: 20px; font-size: 19px; color: var(--navy-800); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid label { display: flex; flex-direction: column; font-size: 13px; color: #56616f; gap: 7px; font-weight: 500; }
.grid label.full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: #9aa4b2; margin-top: 14px; line-height: 1.7; }

/* 图片上传 */
.upload-label { font-size: 13px; color: #56616f; margin-bottom: 10px; font-weight: 500; }
.img-list { display: flex; flex-wrap: wrap; gap: 12px; }
.img-thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; background: rgba(12,23,38,.6); color: #fff; border-radius: 50%; font-size: 14px; line-height: 20px; text-align: center; cursor: pointer; }
.img-add { width: 92px; height: 92px; border: 1.5px dashed #cdd5e1; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; cursor: pointer; background: #f7f9fc; transition: all .15s; }
.img-add:hover { border-color: var(--gold); color: var(--gold); background: #fffaf0; }
.modal-foot { display: flex; justify-content: flex-end; margin-top: 24px; gap: 4px; }
.modal-foot button:disabled { opacity: .5; cursor: not-allowed; }

/* 批量导入 */
.import-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.import-tools .chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #56616f; }
.import-tools .chk input { width: auto; }
.file-btn { display: inline-block; background: #fff; color: #455261; border: 1px solid var(--line); border-radius: 9px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.file-btn:hover { background: #f7f9fc; }
.import-area { width: 100%; min-height: 180px; padding: 12px; border: 1px solid #d7deea; border-radius: 10px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; resize: vertical; }

/* 地图选点 */
.loc-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.map-pick-btn { background: #fffaf0; color: #9a7b2e; border: 1px solid #ecdcb6; border-radius: 9px; padding: 8px 15px; font-size: 13px; cursor: pointer; font-weight: 500; margin: 0; }
.map-pick-btn:hover { background: #f9efd6; border-color: var(--gold); }
.loc-coord { font-size: 12px; color: #1f9d57; }
.loc-coord.muted { color: var(--muted); }
.map-modal { width: 720px; }
.map-search { display: flex; gap: 8px; margin-bottom: 8px; }
.map-search input { flex: 1; }
.map-search button { background: linear-gradient(135deg, var(--navy-700), var(--navy-600)); color: #fff; border: none; border-radius: 9px; padding: 0 18px; }
.map-results { list-style: none; max-height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.map-results li { padding: 9px 13px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.map-results li:last-child { border-bottom: 0; }
.map-results li:hover { background: #faf7ef; }
.map-canvas { width: 100%; height: 380px; border-radius: 12px; overflow: hidden; background: #e9eef4; }
.map-tip { font-size: 12px; color: var(--muted); margin-top: 8px; }
.map-coord { font-size: 13px; color: #1f9d57; margin-top: 4px; }

/* ===== 移动端自适应 ===== */
@media (max-width: 768px) {
  .login-wrap { flex-direction: column; }
  .login-aside { flex: none; min-height: 230px; }
  .login-aside-inner { padding: 30px; }
  .login-aside h1 { font-size: 23px; }
  .login-feat { display: none; }
  .login-main { flex: 1; padding: 30px 0; }
  .login-card { width: 88vw; max-width: 360px; }

  .topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 30;
    background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 13px 16px;
  }
  .topbar-title { font-size: 16px; font-weight: 700; }
  .hamburger { background: transparent; border: none; padding: 4px; display: flex; flex-direction: column; gap: 4px; margin: 0; }
  .hamburger span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }

  .layout { flex-direction: column; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 230px; z-index: 50; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(12,23,38,.5); z-index: 40; }

  .content { padding: 16px; }
  .head { flex-wrap: wrap; gap: 10px; }
  .head-actions { width: 100%; }
  .head-actions button { flex: 1; margin-right: 0; }
  .head-actions button + button { margin-left: 8px; }

  section table { display: block; overflow-x: auto; white-space: nowrap; }

  .modal { width: 94vw; max-height: 90vh; padding: 20px; }
  .modal.small { width: 94vw; }
  .map-modal { width: 96vw; }
  .map-canvas { height: 300px; }
  .grid { grid-template-columns: 1fr; }
}
