* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; background: #f5f7fb; color: #172033; }
a { color: #1c5fd4; text-decoration: none; }
.topbar { background: #101827; color: white; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar span { color: #b8c1d1; margin-left: 10px; font-size: 14px; }
.topbar a { color: white; margin-left: 16px; }
.container { max-width: 1180px; margin: 24px auto; padding: 0 16px; }
.panel, .lead-card, .metrics div { background: white; border-radius: 14px; box-shadow: 0 2px 12px rgba(18, 38, 63, .08); padding: 20px; margin-bottom: 18px; }
h1 { margin: 0 0 12px; font-size: 26px; }
h2 { margin: 0 0 12px; font-size: 20px; }
h3 { margin: 16px 0 8px; }
.muted { color: #64748b; }
.flash { background: #e8f4ff; border: 1px solid #b8dcff; padding: 12px; border-radius: 10px; margin-bottom: 16px; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.metrics strong { display: block; font-size: 28px; color: #1c5fd4; }
.metrics span { color: #64748b; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
input, select, textarea { border: 1px solid #d4dbe8; border-radius: 10px; padding: 10px 12px; font: inherit; background: white; }
textarea { resize: vertical; }
.full { grid-column: 1 / -1; }
.checkbox { flex-direction: row; align-items: center; }
.actions { display: flex; gap: 12px; align-items: center; }
button, .button { display: inline-block; border: 0; border-radius: 10px; background: #1c5fd4; color: white; padding: 10px 16px; font-weight: 700; cursor: pointer; }
.button.secondary { background: #e7ecf5; color: #26364f; }
.filters { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: center; }
.inline { flex-direction: row; align-items: center; font-weight: 500; }
.lead-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.badge { border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.crm-ok { background: #dcfce7; color: #166534; }
.crm-warn { background: #fee2e2; color: #991b1b; }
.alert { background: #fff1f2; border-left: 4px solid #e11d48; color: #9f1239; padding: 10px; border-radius: 8px; margin: 10px 0; font-weight: 600; }
.grid-small, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-small div, .detail-grid div { background: #f8fafc; padding: 10px; border-radius: 10px; }
.grid-small b, .detail-grid b { display: block; color: #64748b; font-size: 13px; margin-bottom: 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.reply { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 14px; white-space: pre-wrap; line-height: 1.6; }
.note { border-left: 4px solid #1c5fd4; padding: 10px 12px; background: #f8fafc; border-radius: 8px; margin-bottom: 10px; }
.danger { border: 1px solid #fecdd3; }
.empty { padding: 24px; color: #64748b; text-align: center; }
@media (max-width: 900px) {
  .metrics, .lead-list, .two-col, .form-grid, .filters { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

