:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --primary: #2f5fdb;
  --primary-dark: #2447ad;
  --success: #1a9c6b;
  --warning: #c98a12;
  --danger: #d0403f;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.boot-message { padding: 40px; text-align: center; color: var(--text-muted); }

/* ---- Shell ---- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  flex-shrink: 0;
}

.sidebar h1 { font-size: 16px; margin: 0 0 24px 12px; }

.sidebar nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 2px;
}

.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar nav a:hover:not(.active) { background: var(--bg); }

.sidebar .section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 18px 12px 6px;
}

.main { flex: 1; padding: 28px 32px; max-width: 1100px; }

.page-title { font-size: 22px; margin: 0 0 20px; }

/* ---- Cards / KPIs ---- */

.kpi-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 150px;
  flex: 1;
}

.kpi-card .value { font-size: 26px; font-weight: 600; }
.kpi-card .label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 { font-size: 15px; margin: 0 0 14px; }

/* ---- Tables ---- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---- Buttons / inputs ---- */

button, .btn {
  font-family: inherit;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 14px;
  cursor: pointer;
}

button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover { background: var(--primary-dark); }
button.danger { color: var(--danger); border-color: var(--danger); }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 100%;
}

label { display: block; font-size: 13px; color: var(--text-muted); margin: 10px 0 4px; }

/* ---- Lists / rows ---- */

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }

.progress-bar {
  background: var(--bg);
  border-radius: 6px;
  height: 8px;
  width: 140px;
  overflow: hidden;
}
.progress-bar .fill { background: var(--primary); height: 100%; }

/* ---- Disposition buttons (Call Screen) ---- */

.disposition-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.disposition-btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
}
.disposition-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.disposition-btn.positive.selected { background: var(--success); border-color: var(--success); }
.disposition-btn.dnc.selected { background: var(--danger); border-color: var(--danger); }

.call-card { text-align: center; padding: 32px; }
.call-card .lead-name { font-size: 22px; font-weight: 600; }
.call-card .lead-phone { font-size: 28px; margin: 8px 0 20px; color: var(--primary); font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
}
.badge.overdue { background: #fdeaea; color: var(--danger); }
.badge.today { background: #fff4e0; color: var(--warning); }

.empty-state { text-align: center; padding: 40px; color: var(--text-muted); }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-row .bar-label { width: 160px; flex-shrink: 0; }
.bar-row .bar-track { flex: 1; background: var(--bg); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-row .bar-fill { background: var(--primary); height: 100%; }
.bar-row .bar-value { width: 40px; text-align: right; flex-shrink: 0; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal { background: var(--surface); border-radius: var(--radius); padding: 24px; width: 380px; max-width: 90vw; }
.modal h3 { margin-top: 0; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
