/* ========== 保险线索跟进模块样式 (合并自 sh-insurance) ========== */

/* ---- Login ---- */
.login-body { background: #f0f4f8; }
.login-wrap { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px; }
.login-card { background:#fff; border-radius:16px; padding:40px 32px 32px; width:100%; max-width:400px; box-shadow:0 2px 16px rgba(0,0,0,.06); text-align:center; }
.login-card h1 { font-size:22px; font-weight:600; margin:0 0 4px; color:#1e293b; }
.login-sub { font-size:13px; color:#94a3b8; margin:0 0 28px; }
.login-foot { font-size:12px; color:#94a3b8; margin-top:24px; }

.field { display:block; text-align:left; margin-bottom:16px; }
.field span { display:block; font-size:13px; font-weight:500; color:#475569; margin-bottom:6px; }
.field input { width:100%; padding:12px 14px; font-size:16px; border:1px solid #e2e8f0; border-radius:10px; box-sizing:border-box; outline:none; transition:border-color .15s; }
.field input:focus { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.1); }

.login-card .btn-primary { width:100%; padding:14px; font-size:16px; font-weight:600; border:none; border-radius:10px; background:#1e3a8a; color:#fff; cursor:pointer; margin-top:4px; }
.login-card .btn-primary:disabled { opacity:.6; }
.err { color:#e24b4a; font-size:13px; margin:8px 0 0; min-height:20px; }

/* ---- Layout ---- */
.layout { display:flex; min-height:100vh; }
.sidebar { width:240px; min-width:240px; background:#1e293b; color:#e2e8f0; display:flex; flex-direction:column; padding:0; z-index:100; transition:width .25s ease, min-width .25s ease, transform .25s ease; }
.sidebar > * { flex-shrink:0; }
/* 桌面端折叠：宽度收起，主内容自动占满 */
.layout.collapsed .sidebar { width:0; min-width:0; overflow:hidden; }
.sidebar-mask { display:none; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:99; }
.sidebar-mask.show { display:block; }
.brand { display:flex; align-items:center; gap:12px; padding:20px 20px 16px; border-bottom:1px solid rgba(255,255,255,.08); }
.brand-logo { width:38px; height:38px; background:#3b82f6; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; color:#fff; flex-shrink:0; }
.brand-name { font-size:15px; font-weight:600; }
.brand-sub { font-size:11px; color:#94a3b8; margin-top:2px; }
.nav { flex:1; overflow-y:auto; padding:12px 0; }
.nav-sep { font-size:11px; color:#64748b; padding:10px 20px 6px; text-transform:uppercase; letter-spacing:.5px; }
.nav-item { display:flex; align-items:center; gap:10px; padding:10px 20px; color:#94a3b8; text-decoration:none; font-size:14px; border-radius:0; margin:2px 8px; transition:all .15s; }
.nav-item:hover { color:#e2e8f0; background:rgba(255,255,255,.06); }
.nav-item.active { color:#3b82f6; background:rgba(59,130,246,.12); font-weight:600; }
.nav-ico { font-size:16px; width:20px; text-align:center; }
.sidebar-foot { padding:14px 20px; border-top:1px solid rgba(255,255,255,.08); display:flex; align-items:center; justify-content:space-between; }
.me-name { font-size:13px; font-weight:500; }
.me-role { font-size:11px; color:#94a3b8; }
.logout { font-size:12px; color:#94a3b8; text-decoration:none; cursor:pointer; }
.logout:hover { color:#e24b4a; }

.main { flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar { display:flex; align-items:center; gap:12px; padding:12px 20px; background:#fff; border-bottom:1px solid #e2e8f0; }
.menu-btn { display:block; font-size:22px; background:none; border:none; color:#475569; cursor:pointer; padding:4px; line-height:1; }
.topbar-title { font-size:16px; font-weight:600; color:#1e293b; flex:1; }
.topbar-right { display:flex; gap:8px; }
.content { flex:1; padding:20px; overflow-y:auto; background:#f8fafc; }

/* ---- Stat Cards ---- */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; }
.stat { background:#fff; border-radius:12px; padding:18px 20px; box-shadow:0 1px 4px rgba(0,0,0,.04); }
.stat .k { font-size:12px; color:#94a3b8; margin-bottom:6px; }
.stat .v { font-size:28px; font-weight:700; }
.stat .sub { font-size:12px; color:#94a3b8; margin-top:4px; }
.stat-blue .v { color:#378ADD; }
.stat-amber .v { color:#EF9F27; }
.stat-green .v { color:#639922; }
.stat-red .v { color:#E24B4A; }

/* ---- Card ---- */
.card { background:#fff; border-radius:12px; padding:20px; box-shadow:0 1px 4px rgba(0,0,0,.04); }
.card h3 { font-size:15px; font-weight:600; color:#1e293b; margin:0 0 14px; }

/* ---- Table ---- */
.table-wrap { overflow-x:auto; }
.table-wrap table { width:100%; border-collapse:collapse; font-size:13px; }
.table-wrap th { background:#f8fafc; color:#64748b; font-weight:600; font-size:12px; padding:10px 12px; text-align:left; white-space:nowrap; border-bottom:2px solid #e2e8f0; }
.table-wrap td { padding:10px 12px; border-bottom:1px solid #f1f5f9; color:#334155; }
.table-wrap tr:hover td { background:#f8fafc; }
.table-wrap th:last-child, .table-wrap td:last-child { text-align:right; }

/* ---- Badge ---- */
.badge { display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; font-weight:500; }
.b-new { background:#dbeafe; color:#1d4ed8; }
.b-following { background:#fef3c7; color:#b45309; }
.b-success { background:#dcfce7; color:#15803d; }
.b-lost { background:#fee2e2; color:#dc2626; }
.b-gray { background:#f1f5f9; color:#64748b; }

/* ---- Toolbar ---- */
.toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.spacer { flex:1; }

/* ---- Buttons ---- */
.btn { display:inline-flex; align-items:center; justify-content:center; padding:8px 18px; font-size:14px; font-weight:500; border-radius:8px; border:1px solid #e2e8f0; cursor:pointer; text-decoration:none; transition:all .15s; background:#fff; color:#475569; }
.btn:hover { background:#f8fafc; }
.btn-primary { background:#1e3a8a; border-color:#1e3a8a; color:#fff; }
.btn-primary:hover { background:#1e40af; }
.btn-outline { background:transparent; border-color:#cbd5e1; color:#475569; }
.btn-outline:hover { background:#f1f5f9; }
.btn-success { background:#15803d; border-color:#15803d; color:#fff; }
.btn-success:hover { background:#166534; }
.btn-danger { background:#dc2626; border-color:#dc2626; color:#fff; }
.btn-danger:hover { background:#b91c1c; }
.btn-sm { padding:5px 12px; font-size:12px; }
.btn-block { display:flex; width:100%; }

/* ---- Input ---- */
.input { padding:8px 12px; font-size:14px; border:1px solid #e2e8f0; border-radius:8px; outline:none; background:#fff; color:#334155; box-sizing:border-box; transition:border-color .15s; }
.input:focus { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.1); }
select.input { padding:8px 10px; }

/* ---- Form ---- */
.form-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px 18px; }
.form-item { display:flex; flex-direction:column; }
.form-item label { font-size:13px; font-weight:500; color:#475569; margin-bottom:6px; }
.form-item .input { width:100%; }
.req { color:#e24b4a; }

/* ---- Alert ---- */
.alert-item { display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.alert-item .dot { width:8px; height:8px; border-radius:50%; margin-top:5px; flex-shrink:0; background:#ef9f27 }
.alert-item .info .t { font-size:14px; font-weight:500; color:#1e293b; }
.alert-item .info .s { font-size:12px; color:#94a3b8; margin-top:2px; }
.alert-item .btn { flex-shrink:0; }

/* ---- Timeline ---- */
.timeline { padding-left:20px; border-left:2px solid #e2e8f0; }
.tl-item { margin-bottom:16px; }
.tl-date { font-size:12px; color:#94a3b8; margin-bottom:4px; }
.tl-body { font-size:14px; color:#334155; line-height:1.6; }

/* ---- Modal ---- */
.modal-mask { display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:200; align-items:center; justify-content:center; }
.modal-mask.show { display:flex; }
.modal-mask .modal { display:block; position:static; background:#fff; border-radius:14px; padding:24px; width:90%; max-width:500px; max-height:80vh; overflow-y:auto; box-shadow:0 8px 30px rgba(0,0,0,.12); }
.modal-mask .modal h3 { font-size:16px; font-weight:600; margin:0 0 16px; color:#1e293b; }
.actions { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }

/* ---- Tel Link ---- */
.tel-link { color:#1e3a8a; text-decoration:none; font-weight:500; }
.tel-link:hover { text-decoration:underline; }

/* ---- Pagination ---- */
.pagination { display:flex; align-items:center; gap:6px; padding:14px 0 0; flex-wrap:wrap; }
.page-btn { padding:5px 12px; border:1px solid #e2e8f0; border-radius:6px; background:#fff; font-size:12px; color:#475569; cursor:pointer; }
.page-btn.active { background:#1e3a8a; color:#fff; border-color:#1e3a8a; }
.page-btn:hover:not(.active) { background:#f1f5f9; }

/* ---- Chart ---- */
.chart { width:100%; height:300px; }
.chart-tall { width:100%; height:420px; }

/* ---- Toolbar (看板顶部时间切换) ---- */
.period-bar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px 16px; margin-top:14px; background:#fff; border-radius:12px; box-shadow:0 1px 4px rgba(0,0,0,.04); }
.period-bar .seg { display:inline-flex; border:1px solid #e2e8f0; border-radius:8px; overflow:hidden; }
.period-bar .seg button { padding:6px 16px; background:#fff; border:0; font-size:13px; color:#475569; cursor:pointer; transition:all .15s; }
.period-bar .seg button:not(:last-child) { border-right:1px solid #e2e8f0; }
.period-bar .seg button.active { background:#1e3a8a; color:#fff; }
.period-bar .seg button:hover:not(.active) { background:#f1f5f9; }
.period-bar .sel { padding:6px 10px; border:1px solid #e2e8f0; border-radius:8px; font-size:13px; background:#fff; }
.period-bar .lbl { color:#64748b; font-size:13px; }
.period-bar .range { color:#1e3a8a; font-weight:600; }

/* ---- Link ---- */
.link { color:#1e3a8a; text-decoration:none; }
.link:hover { text-decoration:underline; }

/* ---- Empty ---- */
.empty { text-align:center; padding:30px 0; color:#94a3b8; font-size:14px; }

/* ---- Rank bar ---- */
.rank-bar { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #f1f5f9; }
.rank-bar .nm { font-size:13px; font-weight:500; min-width:50px; color:#334155; }
.rank-bar .bar { flex:1; height:6px; background:#f1f5f9; border-radius:3px; overflow:hidden; }
.rank-bar .bar i { display:block; height:100%; background:#3b82f6; border-radius:3px; }
.rank-bar .nm2 { font-size:11px; color:#94a3b8; white-space:nowrap; }

/* ---- Lost option ---- */
.lost-opt { display:flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid #e2e8f0; border-radius:8px; cursor:pointer; transition:all .15s; font-size:14px; }
.lost-opt:hover { background:#f8fafc; }

/* ---- Toast ---- */
.toast { position:fixed; top:20px; left:50%; transform:translateX(-50%); padding:10px 24px; border-radius:10px; font-size:14px; z-index:999; opacity:0; transition:opacity .25s; pointer-events:none; }
.toast.show { opacity:1; }
.toast.ok { background:#15803d; color:#fff; }
.toast.err { background:#dc2626; color:#fff; }

/* ---- Plate Keyboard ---- */
.modal-mask .plate-modal { max-width:420px; }
.plate-display { display:flex; gap:4px; justify-content:center; margin-bottom:16px; min-height:42px; align-items:center; }
.plate-char { display:inline-flex; align-items:center; justify-content:center; width:36px; height:42px; border:2px solid #3b82f6; border-radius:6px; font-size:18px; font-weight:700; color:#1e293b; }
.plate-label { font-size:12px; color:#94a3b8; margin-bottom:6px; }
.plate-province, .plate-keys { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:8px; }
.plate-key { width:38px; height:38px; border:1px solid #e2e8f0; border-radius:6px; background:#f8fafc; font-size:14px; font-weight:500; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.plate-key:hover { background:#e2e8f0; }
.plate-key-num { background:#eff6ff; }
.plate-actions { display:flex; gap:8px; margin-top:12px; justify-content:flex-end; }

/* ---- Flash ---- */
.flash { padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:14px; }
.flash-error { background:#fee2e2; color:#dc2626; border:1px solid #fecaca; }

/* ---- Grid ---- */
.grid { display:grid; gap:14px; }

/* ---- Mobile ---- */
@media (max-width:768px) {
  .sidebar { position:fixed; left:0; top:0; bottom:0; transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  /* 移动端不受桌面端折叠影响，恢复固定宽度 */
  .layout.collapsed .sidebar { width:240px; min-width:240px; overflow:visible; }
  .menu-btn { display:block; }
  .topbar { padding:10px 14px; }
  .content { padding:14px; }
  .form-grid { grid-template-columns:1fr; }
  .stat-grid { grid-template-columns:repeat(2,1fr); }
  .login-card { max-width:100%; padding:28px 20px 24px; }
  .login-card h1 { font-size:20px; }
  .field input { font-size:16px; padding:12px; }
  .modal-mask .modal { max-width:95%; }
}