/* ===== GP Stakes Firm CRM — design system (white + corporate blue) ===== */
:root {
  --blue:        #1761B0;   /* primary medium blue (JPMorgan/IBM family) */
  --blue-dark:   #0E4A8A;
  --navy:        #0A2E52;
  --blue-tint:   #EAF1FA;   /* light blue wash for active/hover */
  --bg:          #F4F6F9;
  --white:       #FFFFFF;
  --text:        #1A2330;
  --muted:       #5B6675;
  --border:      #E3E8EF;
  --green:       #1E874B;
  --amber:       #B7791F;
  --red:         #C0392B;
  --shadow:      0 1px 3px rgba(16,32,55,.06), 0 1px 2px rgba(16,32,55,.08);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Brand mark ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; letter-spacing: .02em;
}
.brand .name { font-weight: 600; color: var(--navy); font-size: 15px; letter-spacing: .01em; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--white); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: 32px 28px;
}
.login-card .brand { justify-content: center; margin-bottom: 4px; }
.login-card .tagline { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 5px; }
.login-card input {
  width: 100%; padding: 11px 12px; font-size: 15px; color: var(--text);
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
}
.login-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.btn-primary {
  width: 100%; margin-top: 20px; padding: 12px; font-size: 15px; font-weight: 600;
  background: var(--blue); color: #fff; border: none; border-radius: 8px;
}
.btn-primary:hover { background: var(--blue-dark); }
.login-error { color: var(--red); font-size: 13px; margin-top: 14px; min-height: 18px; text-align: center; }
.login-foot { text-align: center; margin-top: 16px; font-size: 13px; }
.login-foot a { cursor: pointer; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100%; }
.sidebar {
  width: 232px; flex: none; background: var(--white); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px;
}
.sidebar .brand { padding: 6px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: 13.5px;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--blue-tint); color: var(--blue-dark); font-weight: 600; }
.nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; }
.nav .section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 16px 11px 6px; font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; flex: none; background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
}
.topbar .title { font-size: 16px; font-weight: 600; color: var(--navy); }
.topbar .user { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.btn-ghost {
  background: var(--white); border: 1px solid var(--border); color: var(--text);
  padding: 7px 13px; border-radius: 7px; font-size: 13px; font-weight: 500;
}
.btn-ghost:hover { background: var(--bg); }
.content { padding: 24px; overflow: auto; }

/* ---------- Dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 30px; font-weight: 700; color: var(--navy); margin-top: 6px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.panel {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px; box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 6px; font-size: 16px; color: var(--navy); }
.panel p { margin: 0; color: var(--muted); }
.badge { display: inline-block; background: var(--blue-tint); color: var(--blue-dark);
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; margin-left: 8px; }

/* ---------- Responsive (iPad / phone) ---------- */
@media (max-width: 720px) {
  .sidebar { width: 64px; padding: 14px 8px; }
  .sidebar .brand .name, .nav a span, .nav .section-label { display: none; }
  .nav a { justify-content: center; padding: 11px; }
  .topbar .user .email { display: none; }
}

/* ===== Components (Phases 2–4) ===== */
.toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:16px; }
.toolbar .spacer { flex:1; }
.input, .select { padding:9px 11px; font-size:14px; color:var(--text); background:var(--white);
  border:1px solid var(--border); border-radius:8px; font-family:inherit; }
.input:focus, .select:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px var(--blue-tint); }
.search { min-width:200px; }
.btn { padding:9px 14px; font-size:14px; font-weight:600; border-radius:8px; border:none; background:var(--blue); color:#fff; }
.btn:hover { background:var(--blue-dark); }
.btn.secondary { background:var(--white); color:var(--text); border:1px solid var(--border); }
.btn.secondary:hover { background:var(--bg); }
.btn.danger { background:var(--white); color:var(--red); border:1px solid var(--border); }
.btn.small { padding:6px 11px; font-size:12.5px; }

.card-table { background:var(--white); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); overflow:hidden; }
table.grid { width:100%; border-collapse:collapse; }
table.grid th { text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted);
  font-weight:600; padding:12px 14px; border-bottom:1px solid var(--border); background:#FAFBFD; }
table.grid td { padding:12px 14px; border-bottom:1px solid var(--border); font-size:14px; }
table.grid tr:last-child td { border-bottom:none; }
table.grid tbody tr.clickable:hover { background:var(--blue-tint); cursor:pointer; }
.empty-state { padding:40px; text-align:center; color:var(--muted); }

.pill2 { display:inline-block; font-size:11.5px; font-weight:600; padding:3px 10px; border-radius:20px;
  background:var(--bg); color:var(--muted); border:1px solid var(--border); white-space:nowrap; }
.pill-type { background:var(--blue-tint); color:var(--blue-dark); border-color:transparent; }
.pill-stage { background:#EEF6F0; color:var(--green); border-color:transparent; }

.modal-overlay { position:fixed; inset:0; background:rgba(10,24,44,.45); display:flex; align-items:flex-start;
  justify-content:center; padding:30px 16px; overflow:auto; z-index:50; }
.modal { width:100%; max-width:560px; background:var(--white); border-radius:14px; box-shadow:0 20px 50px rgba(10,32,55,.3); }
.modal-header { padding:18px 22px; border-bottom:1px solid var(--border); font-size:16px; font-weight:600;
  color:var(--navy); display:flex; justify-content:space-between; align-items:center; }
.modal-header .x { background:none; border:none; font-size:22px; color:var(--muted); line-height:1; }
.modal-body { padding:20px 22px; max-height:65vh; overflow:auto; }
.modal-foot { padding:16px 22px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }

.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 14px; }
.field { display:flex; flex-direction:column; }
.field.full { grid-column:1 / -1; }
.field label { font-size:12px; font-weight:600; color:var(--muted); margin-bottom:5px; }
.field input, .field select, .field textarea { padding:9px 11px; font-size:14px; border:1px solid var(--border);
  border-radius:8px; font-family:inherit; background:var(--white); color:var(--text); }
.field textarea { min-height:64px; resize:vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px var(--blue-tint); }
.subhead { font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:700; margin:16px 0 2px; grid-column:1/-1; }
.checklist { border:1px solid var(--border); border-radius:8px; max-height:130px; overflow:auto; padding:6px 10px; }
.checklist label { display:flex; align-items:center; gap:8px; font-size:13.5px; font-weight:500; color:var(--text); margin:0; padding:4px 0; }
.checklist input { width:auto; }

.back { background:none; border:none; color:var(--blue); font-weight:600; padding:0; margin-bottom:14px; font-size:13.5px; cursor:pointer; }
.profile-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.profile-head h1 { margin:0 0 8px; font-size:22px; color:var(--navy); }
.profile-head .meta { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; }
.detail .dl { font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:600; }
.detail .dv { font-size:14px; margin-top:2px; }
.section-title { font-size:14px; font-weight:700; color:var(--navy); }
.timeline { display:flex; flex-direction:column; gap:10px; }
.tl-item { background:var(--white); border:1px solid var(--border); border-radius:10px; padding:12px 14px; }
.tl-item .tl-top { display:flex; justify-content:space-between; gap:10px; }
.tl-item .tl-date { color:var(--muted); font-size:12.5px; }
.tl-item .tl-notes { margin-top:6px; color:var(--text); font-size:13.5px; white-space:pre-wrap; }

.board { display:flex; gap:14px; overflow-x:auto; padding-bottom:10px; }
.column { min-width:248px; width:248px; flex:none; background:#F0F3F7; border:1px solid var(--border); border-radius:12px; padding:10px; }
.col-head { display:flex; justify-content:space-between; align-items:center; font-size:12.5px; font-weight:700; color:var(--navy); padding:4px 6px 10px; }
.col-head .cnt { color:var(--muted); font-weight:600; }
.kcard { background:var(--white); border:1px solid var(--border); border-radius:9px; padding:10px 11px; margin-bottom:9px; box-shadow:var(--shadow); }
.kcard .kname { font-weight:600; color:var(--navy); font-size:14px; cursor:pointer; }
.kcard .kname:hover { color:var(--blue); }
.kcard .kmeta { color:var(--muted); font-size:12px; margin:4px 0 8px; }
.kcard select { width:100%; font-size:12px; padding:5px 6px; border:1px solid var(--border); border-radius:6px; background:var(--white); }

.task-row { display:flex; align-items:center; gap:12px; padding:11px 14px; border-bottom:1px solid var(--border); }
.task-row:last-child { border-bottom:none; }
.task-row input[type=checkbox] { width:18px; height:18px; flex:none; }
.task-row .t-title { font-weight:500; flex:1; }
.task-row.done .t-title { text-decoration:line-through; color:var(--muted); }
.due { font-size:12.5px; color:var(--muted); }
.due.overdue { color:var(--red); font-weight:600; }
.list-head { display:flex; justify-content:space-between; align-items:center; margin:24px 0 12px; }

.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--navy); color:#fff;
  padding:11px 18px; border-radius:10px; font-size:13.5px; box-shadow:0 10px 30px rgba(0,0,0,.3); z-index:80; opacity:0; transition:opacity .2s; }
.toast.show { opacity:1; }

.seg { display:inline-flex; background:var(--bg); border:1px solid var(--border); border-radius:9px; padding:3px; gap:3px; }
.seg button { border:none; background:none; padding:7px 14px; font-size:13.5px; font-weight:600; color:var(--muted); border-radius:7px; }
.seg button.active { background:var(--white); color:var(--blue-dark); box-shadow:var(--shadow); }

@media (max-width: 720px) { #dash-cols { grid-template-columns:1fr !important; } }
@media (max-width: 600px) { .form-grid { grid-template-columns:1fr; } }

/* ===== Two-factor enrollment dialog ===== */
.mfa-steps { margin:0 0 18px; padding-left:20px; color:var(--text); font-size:13.5px; line-height:1.7; }
.mfa-steps li { margin-bottom:5px; }
.mfa-steps li::marker { color:var(--blue); font-weight:700; }
.mfa-qr { display:flex; justify-content:center; margin:4px 0 18px; }
.mfa-qr img { width:200px; height:200px; padding:12px; background:#fff; border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow); }
input.mono { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing:1px; color:var(--muted); }
input.mfa-code { text-align:center; font-size:22px; letter-spacing:8px; font-weight:700; color:var(--navy); }
