:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  font-size: 14px;
}

.main-content {
  padding-top: 70px;
  padding-bottom: 20px;
  min-height: 100vh;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 30px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-card .brand {
  text-align: center;
  margin-bottom: 30px;
}
.login-card .brand h1 {
  font-size: 28px;
  color: var(--primary);
  font-weight: 700;
}
.login-card .brand p {
  color: #888;
  font-size: 13px;
  margin-top: 5px;
}

/* 统计卡片 */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}
.stat-card .stat-label {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-picked { background: #dbeafe; color: #1e40af; }
.status-warehouse_in { background: #e0e7ff; color: #3730a3; }
.status-transit { background: #fce7f3; color: #9d174d; }
.status-warehouse_out { background: #ede9fe; color: #5b21b6; }
.status-delivering { background: #d1fae5; color: #065f46; }
.status-delivered { background: #d1fae5; color: #047857; }
.status-cancelled { background: #f3f4f6; color: #6b7280; }

/* 运单卡片 */
.order-card {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-left: 4px solid var(--primary);
}
.order-card .order-no {
  font-weight: 600;
  color: var(--primary);
  font-size: 13px;
}
.order-card .order-info {
  font-size: 13px;
  color: #555;
  margin-top: 8px;
}
.order-card .order-info .name {
  font-weight: 600;
  color: #333;
}

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 30px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item .time {
  font-size: 12px;
  color: #999;
}
.timeline-item .desc {
  font-size: 14px;
  color: #333;
  margin-top: 2px;
}

/* 快捷操作 */
.quick-actions {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}
.quick-actions .btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 表格优化 */
.table-responsive {
  border-radius: 10px;
  overflow: hidden;
}

/* 查询页 */
.track-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #2563eb 0%, #2563eb 200px, #f0f2f5 200px);
}
.track-header {
  padding: 40px 20px 30px;
  color: #fff;
  text-align: center;
}
.track-header h1 { font-size: 24px; font-weight: 700; }
.track-card {
  background: #fff;
  border-radius: 16px;
  margin: 0 15px 20px;
  padding: 25px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
  .stat-card .stat-number { font-size: 22px; }
  .main-content { padding-top: 60px; }
  .navbar-brand { font-size: 18px !important; }
}

/* ===== 条码/标签相关 ===== */
.barcode-box {
  background: #fff; border: 1px dashed #cbd5e1; border-radius: 8px;
  padding: 10px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 8px;
}
.barcode-box svg { max-width: 60%; }
.barcode-box .qr-box { border: 1px solid #ddd; padding: 3px; }
.btn-barcode {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; color: #2563eb; border: 1px solid #2563eb;
  border-radius: 6px; font-size: 12px; padding: 4px 10px;
}
.btn-barcode:hover { background: #2563eb; color: #fff; }

/* ===== 库存预警高亮 ===== */
.low-stock { background: #fef2f2 !important; }
.low-stock .badge { background: #dc2626 !important; }

/* ===== 台账时间线 ===== */
.log-row {
  background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.log-row .type-badge { width: 46px; text-align: center; }
.log-row .in-badge { background: #dcfce7; color: #166534; }
.log-row .out-badge { background: #fee2e2; color: #991b1b; }

/* ===== 报表 ===== */
.chart-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 15px; }
.chart-box { position: relative; height: 240px; }

/* ===== 底部标签导航（移动端快捷入口） ===== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: #fff; border-top: 1px solid #e5e7eb;
  display: flex; justify-content: space-around; padding: 6px 0 8px;
}
.tabbar a { text-align: center; color: #6b7280; font-size: 10px; text-decoration: none; flex: 1; }
.tabbar a i { display: block; font-size: 20px; margin-bottom: 2px; }
.tabbar a.active { color: #2563eb; }
body.has-tabbar .main-content { padding-bottom: 70px; }

/* ===== 库位卡片 ===== */
.loc-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-left: 4px solid #16a34a; }
.loc-card .code { font-weight: 700; color: #166534; font-size: 16px; }
.loc-card .meta { font-size: 12px; color: #888; margin-top: 4px; }

/* ===== 客户/司机卡片 ===== */
.person-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.person-card .p-name { font-weight: 600; font-size: 15px; }
.person-card .p-meta { font-size: 12px; color: #888; margin-top: 4px; }

/* 设置页 */
.setting-item { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.setting-item label { font-size: 13px; color: #666; font-weight: 500; }

/* 表格小按钮 */
.btn-xxs { font-size: 11px; padding: 2px 8px; }
