/* 进销存财务系统 — 自定义样式 */

body { font-size: .875rem; background: #f5f6fa; }

/* 业务面板大字块 */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .5rem; }
.field-card { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;
  padding: .6rem .4rem; border-radius: .5rem; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08);
  text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.field-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.12); color: inherit; }
.field-card .icon { font-size: 1.3rem; margin-bottom: .15rem; }
.field-card .label { font-weight: 600; font-size: .75rem; }
.card-badge { position: absolute; top: 2px; right: 2px; font-size: .65rem; }

/* 看板卡片 */
.stat-card { border-radius: .75rem; padding: 1.25rem; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-card .stat-label { font-size: .8rem; color: #6c757d; }

/* 紧凑摘要卡片（客户详情、铺市等手机端） */
.stat-summary { background: #fff; border-radius: .75rem; text-align: center; height: 100%; padding: .6rem .4rem; }
.stat-summary .value { font-weight: 700; font-size: 1.1rem; }
.stat-summary .label { font-size: .8rem; color: #6c757d; line-height: 1.3; }
.stat-summary .note { font-size: 10px; color: #6b7280; line-height: 1.2; }

/* 交账汇总 */
.settlement-card { border-radius: .75rem; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.settlement-card .sp-name { font-weight: 600; font-size: 1.1rem; }
.settlement-card .sp-stat { font-size: .85rem; color: #6c757d; }
.settlement-card .sp-stat strong { color: #212529; }

/* 表格紧凑 */
.table-sm td, .table-sm th { padding: .4rem .5rem; vertical-align: middle; }
.table-hover tbody tr { cursor: default; }

/* 道路名自动补全 */
#road-autocomplete .list-group-item { font-size:14px; cursor:pointer; }
#road-autocomplete .list-group-item:hover { background:#e9ecef; }
#road-autocomplete .list-group-item[style*="pointer-events:none"] { cursor:default; font-weight:600; background:#f8f9fa; }

/* ── 签到客户列表 ── */
#customer-list { max-height:250px; overflow-y:auto; }
.customer-list-item {
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 12px; cursor:pointer; border-bottom:1px solid #eee;
  transition:background .15s; font-size:14px;
}
.customer-list-item:hover { background:#e9ecef; }
.customer-list-item.is-selected { background:#d1e7dd; font-weight:600; }
.customer-list-item .dist-badge {
  font-size:11px; padding:1px 8px; border-radius:10px; white-space:nowrap; color:#fff;
}

/* ── 图钉标签可点击 ── */
.customer-marker { overflow: visible !important; width: auto !important; height: auto !important; }

/* ── 客户标记脉冲 ── */
@keyframes marker-pulse {
  0%   { box-shadow:0 0 0 0 rgba(25,135,84,.5); }
  70%  { box-shadow:0 0 0 14px rgba(25,135,84,0); }
  100% { box-shadow:0 0 0 0 rgba(25,135,84,0); }
}

/* 拜访计划 */
.plan-item { border-left: 4px solid #dee2e6; transition: all .2s; }
.plan-item.completed { border-left-color: #198754; background: #f0f9f4; }
.plan-item.skipped { border-left-color: #adb5bd; background: #f8f9fa; opacity: .7; }
.plan-item.completed .item-name { text-decoration: line-through; color: #6c757d; }
.plan-item.skipped .item-name { text-decoration: line-through; color: #adb5bd; }

/* ── 底部导航栏（业务员手机端）── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
  display: flex; justify-content: space-around; align-items: flex-end;
  background: #fff; border-top: 1px solid #dee2e6;
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: #6c757d;
  font-size: 10px; line-height: 1.2; padding: 2px 6px; min-width: 48px;
  transition: color .15s;
}
.bottom-nav-item .icon { font-size: 20px; line-height: 1.2; margin-bottom: 1px; }
.bottom-nav-item.active { color: #0d6efd; font-weight: 600; }
.bottom-nav-item.active .icon { transform: scale(1.1); }
.bottom-nav-add .icon {
  font-size: 22px;
  background: #0d6efd; color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px; box-shadow: 0 2px 8px rgba(13,110,253,.35);
}
.bottom-nav-add.active .icon { background: #0b5ed7; transform: scale(1.08); }

/* 业务员紧凑顶部栏 */
.navbar-compact .navbar-brand { font-size: .85rem; }
.navbar-compact .nav-link { font-size: .8rem; padding: .2rem .5rem; }

/* body 有底部栏时加 padding，避免内容被遮挡 */
body.has-bottom-nav main { padding-bottom: 65px; }

/* 手机适配 */
@media (max-width: 576px) {
  .field-grid { grid-template-columns: repeat(2, 1fr); }
  .container-fluid { padding-left: .5rem; padding-right: .5rem; }
  main.container-fluid { margin-top: .5rem !important; }
  h4 { font-size: 1.05rem; }
  h5 { font-size: .95rem; margin-bottom: .25rem !important; }
  h6 { font-size: .85rem; margin-bottom: .25rem !important; }
  .navbar-brand { font-size: .9rem; }
  .navbar .nav-link { font-size: .8rem; padding: .25rem .4rem; }
  .mb-3 { margin-bottom: .5rem !important; }
  .mt-3 { margin-top: .5rem !important; }
  .mb-4 { margin-bottom: .75rem !important; }
  .badge { font-size: .65rem; }
  .btn-sm { font-size: .75rem; padding: .2rem .4rem; }
  .form-control-sm { font-size: .8rem; }
  .alert { padding: .4rem .75rem; margin-bottom: .5rem; font-size: .8rem; }
  .small, small { font-size: .75rem; }
  .nav-tabs .nav-link { font-size: .8rem; padding: .3rem .5rem; }
}

/* POI标记常驻标签 */
.poi-label {
  font-size: 11px;
  background: rgba(255,255,255,.9);
  color: #333;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.poi-label::before {
  border-top-color: rgba(255,255,255,.9) !important;
}

/* 客户名标签：视口内+缩放达阈值动态显示（由 initCustomerLabelManager 管理） */
.customer-label {
  background: rgba(255,255,255,.85) !important;
  border: none !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.1) !important;
  font-size: 11px;
  color: #333;
  padding: 2px 5px;
  border-radius: 2px;
  white-space: nowrap;
  cursor: pointer;
}
.customer-label::before {
  display: none;
}
