/* YOO CRM — 基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f5f5; color: #333; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.header { background: #fff; border-bottom: 1px solid #e5e5e5; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.header .logo { font-size: 18px; font-weight: 700; color: #2563eb; }
.header .user-info { font-size: 14px; color: #666; }
.header .btn-logout { margin-left: 12px; padding: 4px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; }
.header .btn-logout:hover { background: #fee; border-color: #fcc; color: #dc2626; }

/* ── Tab bar ── */
.tab-bar { display: flex; gap: 0; background: #fff; border-bottom: 2px solid #e5e5e5; padding: 0 20px; }
.tab-item { padding: 10px 20px; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.tab-item:hover { color: #2563eb; }
.tab-item.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.tab-item .badge { display: inline-block; background: #e5e5e5; color: #666; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: 4px; }
.tab-item.active .badge { background: #dbeafe; color: #2563eb; }

/* ── Search ── */
.search-bar { padding: 12px 20px; display: flex; gap: 8px; }
.search-bar input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.search-bar button { padding: 8px 16px; background: #2563eb; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
.search-bar button:hover { background: #1d4ed8; }

/* ── Card list ── */
.card-list { padding: 0 20px 20px; }
.cust-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: box-shadow 0.15s; }
.cust-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.cust-card .card-row { display: flex; justify-content: space-between; align-items: center; }
.cust-card .card-name { font-size: 15px; font-weight: 600; }
.cust-card .card-phone { font-size: 13px; color: #888; margin-left: 8px; }
.cust-card .card-meta { font-size: 12px; color: #999; margin-top: 4px; display: flex; gap: 12px; }
.cust-card .card-trace { font-size: 12px; color: #666; margin-top: 6px; background: #f9fafb; padding: 6px 8px; border-radius: 4px; }
.tier-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.tier-A { background: #fef3c7; color: #92400e; }
.tier-B { background: #e0e7ff; color: #3730a3; }
.status-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.status-active { background: #dcfce7; color: #166534; }
.status-deal { background: #dbeafe; color: #1e40af; }
.status-lost { background: #f3f4f6; color: #6b7280; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 16px 0; }
.pagination button { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; }
.pagination button:hover { background: #f5f5f5; }
.pagination button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* ── Detail page ── */
.detail-container { max-width: 800px; margin: 0 auto; padding: 20px; }
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.btn-back { padding: 6px 14px; background: #fff; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-back:hover { background: #f5f5f5; }
.btn { padding: 6px 14px; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-default { background: #fff; border: 1px solid #ddd; }

/* ── Info card ── */
.info-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.info-card h3 { font-size: 16px; margin-bottom: 12px; color: #333; }
.info-row { display: flex; padding: 6px 0; font-size: 14px; }
.info-row .info-label { width: 100px; color: #888; flex-shrink: 0; }
.info-row .info-value { color: #333; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.form-group textarea { resize: vertical; min-height: 80px; }

/* ── Timeline ── */
.timeline { margin-top: 8px; }
.timeline-item { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.timeline-item:last-child { border-bottom: none; }
.timeline-item .tl-meta { font-size: 12px; color: #999; margin-bottom: 4px; }
.timeline-item .tl-content { font-size: 14px; color: #333; white-space: pre-wrap; }

/* ── Admin panel ── */
.admin-layout { display: flex; min-height: calc(100vh - 49px); }
.admin-sidebar { width: 180px; background: #fff; border-right: 1px solid #e5e5e5; padding: 12px 0; flex-shrink: 0; }
.admin-sidebar .menu-item { padding: 10px 20px; cursor: pointer; font-size: 14px; color: #666; }
.admin-sidebar .menu-item:hover { background: #f5f5f5; }
.admin-sidebar .menu-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.admin-content { flex: 1; padding: 20px; overflow-y: auto; }
.admin-content h3 { margin-bottom: 16px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.data-table th { background: #f9fafb; padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 600; color: #666; border-bottom: 1px solid #e5e5e5; }
.data-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.data-table tr:hover td { background: #fafafa; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input, .inline-form select { padding: 5px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.status-dot.on { background: #16a34a; }
.status-dot.off { background: #d1d5db; }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 100; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 8px; padding: 24px; min-width: 360px; max-width: 480px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.modal-box h3 { margin-bottom: 16px; }
.modal-box .modal-actions { margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ── Loading ── */
.loading { text-align: center; padding: 40px; color: #999; }
.error-msg { color: #dc2626; font-size: 13px; margin-top: 4px; }
