/* BridgeAI Pipeline Dashboard */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #718096;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 2rem;
}

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

header { margin-bottom: 2rem; }

h1 { font-size: 1.5rem; font-weight: 700; }

.summary-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
}

.metric-card .label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.metric-card .value { font-size: 1.5rem; font-weight: 700; margin-top: .25rem; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.section-title { font-size: 1rem; font-weight: 600; }

.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .5rem 1rem;
  font-size: .875rem;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--primary-hover); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); }

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

thead { background: #f1f5f9; }

th {
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}

td {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* Stage badges */
.stage-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}

.stage-lead     { background: #eff6ff; color: #2563eb; }
.stage-contacted { background: #fef3c7; color: #b45309; }
.stage-discovery { background: #ede9fe; color: #7c3aed; }
.stage-proposal  { background: #d1fae5; color: #065f46; }
.stage-won       { background: #d1fae5; color: #065f46; }
.stage-lost      { background: #fee2e2; color: #991b1b; }

/* Sector badges */
.sector-badge {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #f1f5f9;
  color: #475569;
  letter-spacing: .03em;
}

/* Money */
.money { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
}

.modal h2 { font-size: 1.1rem; margin-bottom: 1.25rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; }
.form-group input, .form-group select {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
}

.form-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* Actions column */
.action-btns { display: flex; gap: .5rem; }

/* Editable select */
select.stage-select {
  padding: .25rem .5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .8rem;
  background: white;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 1rem;
  padding: .2rem;
  border-radius: 4px;
}
.delete-btn:hover { background: #fee2e2; color: #991b1b; }

/* Empty state */
.empty { text-align: center; color: var(--text-muted); padding: 3rem; font-size: .9rem; }