@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --canvas: #0a0c10;
  --surface: #12151c;
  --surface-2: #171b24;
  --border: #232936;
  --text: #e7eaf0;
  --text-dim: #9aa3b2;
  --primary: #4172e8;
  --primary-bright: #7ba0ff;
  --success: #35c07a;
  --warn: #e8b04b;
  --danger: #e8542e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
}

h1, h2, h3, .brand { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; }
code, .mono, .meta { font-family: 'IBM Plex Mono', monospace; }

a { color: var(--primary-bright); }

#app { display: flex; min-height: 100vh; }

/* --- Login --- */
.login-screen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 340px;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card p { color: var(--text-dim); margin: 0 0 20px; font-size: 13px; }

input, select, textarea, button {
  font-family: inherit;
  font-size: 14px;
}
input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
}
button:hover { background: var(--primary-bright); }
button.secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
button.danger { background: var(--danger); }
.error-text { color: var(--danger); font-size: 13px; margin-bottom: 10px; }

/* --- Shell --- */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar .brand { font-size: 17px; margin-bottom: 22px; color: var(--primary-bright); }
.sidebar .group-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin: 16px 0 6px; }
.sidebar nav a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar nav a.active { background: var(--surface-2); color: var(--primary-bright); }
.sidebar .footer { margin-top: auto; font-size: 11px; color: var(--text-dim); }

main { flex: 1; padding: 24px 32px; overflow-y: auto; }
main h1 { font-size: 22px; margin: 0 0 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.card .label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.card .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-family: 'Bricolage Grotesque', sans-serif; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { color: var(--text-dim); font-weight: 500; font-size: 12px; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--surface-2); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.badge.status-won { color: var(--success); border-color: var(--success); }
.badge.status-lost { color: var(--danger); border-color: var(--danger); }

.toolbar { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar input { margin-bottom: 0; width: 220px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 10px; font-size: 14px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }

.pipeline-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.pipeline-col { min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.pipeline-col h4 { font-size: 12px; text-transform: uppercase; color: var(--text-dim); margin: 4px 6px 10px; }
.pipeline-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; cursor: pointer; }
.pipeline-card:hover { border-color: var(--primary); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; width: 420px; max-height: 85vh; overflow-y: auto; }
.modal h2 { margin-top: 0; font-size: 17px; }

.empty-state { color: var(--text-dim); text-align: center; padding: 40px 20px; }
.warn-box { background: rgba(232,176,75,0.12); border: 1px solid var(--warn); color: var(--warn); padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
