:root { --card:#fff; --border:#e5e7eb; --muted:#6b7280; --bg:#f7f7f8; --text:#111827; }

* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; background: var(--bg); color: var(--text); }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display:flex; align-items:center; gap:16px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.brand-link { text-decoration:none; color: var(--text); font-weight: 800; letter-spacing: .3px; }
.nav { display:flex; gap: 10px; align-items:center; flex: 1; }
.nav-link {
  text-decoration:none; color: var(--text);
  padding: 8px 10px; border-radius: 10px;
}
.nav-link:hover { background:#f3f4f6; }
.nav-link.active { background:#111827; color:#fff; }

.logout button { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background:#fff; cursor:pointer; }
.logout button:hover { background:#f3f4f6; }

.hamburger {
  display: none;
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--text);
}
.hamburger svg { display: block; }

@media (max-width: 640px) {
  .hamburger { display: block; }
  .nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 8px 16px; gap: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
  .nav.open { display: flex; }
  .nav-link { width: 100%; }
  .logout { margin-left: auto; }
}

/* ===== Card ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  margin: 12px 0;
}

/* ===== Utility ===== */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.flex-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flex-gap-lg { gap: 24px; }

/* ===== Table ===== */
.table { width:100%; border-collapse: collapse; background: #fff; border:1px solid var(--border); border-radius: 14px; overflow:hidden; }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--border); text-align:left; }
.table th { background:#f9fafb; font-weight:600; }

/* ===== Forms ===== */
input, select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:#fff;
}

button { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background:#111827; color:#fff; cursor:pointer; }
button:hover { opacity: .92; }
button.btn-danger { background: #ef4444; border-color: #ef4444; }
button.btn-sm { font-size: 12px; padding: 6px 12px; }

textarea {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  width: 100%;
  resize: vertical;
}
a { color: inherit; }

/* ===== Badges ===== */
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; display: inline-block; }
.badge-new       { background:#f3f4f6; color:#374151; }
.badge-contacted { background:#dbeafe; color:#1d4ed8; }
.badge-meeting   { background:#fef3c7; color:#92400e; }
.badge-won       { background:#dcfce7; color:#15803d; }
.badge-lost      { background:#fee2e2; color:#b91c1c; }
.badge-private   { background:#eff6ff; color:#1d4ed8; }
.badge-business  { background:#fef3c7; color:#92400e; }
.badge-api       { background:#f3e8ff; color:#7e22ce; font-size: 10px; }

/* ===== Filters (leads page) ===== */
.filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:4px; }
.filter-link {
  padding:6px 12px; border-radius:99px; font-size:13px; text-decoration:none;
  border:1px solid #e5e7eb; background:#fff; color:#374151;
}
.filter-link.active { background:#111827; color:#fff; border-color:#111827; }

/* ===== Stat grid (overview) ===== */
.stat-grid { display:grid; gap:12px; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); }
.stat-box {
  background:#fff; border:1px solid #e5e7eb; border-radius:14px;
  padding:16px 18px; text-align:center;
}
.stat-box .num { font-size:2rem; font-weight:800; line-height:1; }
.stat-box .lbl { font-size:13px; color:#6b7280; margin-top:4px; }
.stat-box.new       { border-top:3px solid #6b7280; }
.stat-box.contacted { border-top:3px solid #3b82f6; }
.stat-box.meeting   { border-top:3px solid #f59e0b; }
.stat-box.won       { border-top:3px solid #22c55e; }
.stat-box.lost      { border-top:3px solid #ef4444; }

/* ===== Team table (overview) ===== */
.team-table { width:100%; border-collapse:collapse; }
.team-table th, .team-table td { padding:9px 12px; border-bottom:1px solid #e5e7eb; text-align:left; }
.team-table th { background:#f9fafb; font-weight:600; }
.capacity-bar { height:8px; border-radius:99px; background:#e5e7eb; overflow:hidden; }
.capacity-fill { height:100%; border-radius:99px; background:#22c55e; transition:width .3s; }
.capacity-fill.warn { background:#f59e0b; }
.capacity-fill.full { background:#ef4444; }

/* ===== Section ===== */
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 10px; }
.section-divider { border:none; border-top:1px solid #e5e7eb; margin:12px 0; }

/* ===== Alert banner ===== */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.alert-success { background: #f0fdf4; border: 1px solid #22c55e; }
.alert-danger { background: #fef2f2; border: 1px solid #ef4444; }

/* ===== Followup list (overview) ===== */
.followup-list { margin:0; padding:0; list-style:none; display:grid; gap:8px; }
.followup-item {
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; background:#fff;
}
.followup-item.overdue { border-left:3px solid #ef4444; }
.followup-item.upcoming { border-left:3px solid #f59e0b; }
