/* Insurance Solutions CRM — Buckalew Financial Services */
:root {
  --blue: #285A84;
  --blue-dark: #1d4568;
  --blue-light: #e8f0f7;
  --green: #5EA669;
  --green-light: #85C872;
  --green-pale: #eef7ea;
  --ink: #1f2a33;
  --muted: #66788a;
  --line: #dfe6ec;
  --bg: #f4f7f9;
  --card: #ffffff;
  --amber: #b7791f;
  --amber-bg: #fdf3d7;
  --red: #b3362b;
  --red-bg: #fdecea;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
}
a { color: var(--blue); }
button { font: inherit; cursor: pointer; }

/* ---------- header ---------- */
header.topbar {
  background: var(--blue); color: #fff; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
header.topbar .brand { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
header.topbar .brand small { display: block; font-size: 12px; font-weight: 400; opacity: .85; }
header.topbar .spacer { flex: 1; }
header.topbar .quote-link {
  background: var(--green); color: #fff; text-decoration: none;
  padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
header.topbar .quote-link:hover { background: var(--green-light); }
header.topbar .user { font-size: 14px; opacity: .9; }
header.topbar .linkbtn {
  background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff;
  padding: 6px 12px; border-radius: 8px; font-size: 14px;
}
header.topbar .linkbtn:hover { background: rgba(255,255,255,.15); }

/* ---------- layout ---------- */
.layout { display: flex; min-height: calc(100vh - 61px); }
nav.side {
  width: 210px; flex: 0 0 210px; background: #fff; border-right: 1px solid var(--line);
  padding: 16px 10px; display: flex; flex-direction: column; gap: 4px;
}
nav.side a {
  display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink);
  text-decoration: none; font-weight: 600;
}
nav.side a:hover { background: var(--blue-light); }
nav.side a.active { background: var(--blue); color: #fff; }
nav.side .side-note { margin-top: auto; font-size: 12px; color: var(--muted); padding: 10px 12px; }
main { flex: 1; padding: 20px 24px 40px; min-width: 0; }
h1 { font-size: 22px; margin: 0 0 4px; }
.subtitle { color: var(--muted); margin: 0 0 18px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }

/* ---------- cards & stats ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .num { font-size: 26px; font-weight: 800; color: var(--blue); }
.stat .lbl { font-size: 13px; color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px;
}
.card h2 { margin-top: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .row2 { grid-template-columns: 1fr; } .layout { flex-direction: column; } nav.side { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; } nav.side .side-note { display: none; } }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: #fafbfc; }
tr.clickable { cursor: pointer; }
.money { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- badges & pills ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--blue-light); color: var(--blue-dark); white-space: nowrap;
}
.badge.green { background: var(--green-pale); color: #2c6b3c; }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.demo { background: #efe6f7; color: #6b3fa0; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef1f4; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  background: var(--blue); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-weight: 600;
}
.btn:hover { background: var(--blue-dark); }
.btn.green { background: var(--green); }
.btn.green:hover { background: #4c8a58; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn.danger { background: var(--red); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: default; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="number"], input[type="password"], select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid #c4cfd8; border-radius: 8px;
  background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-light); border-color: var(--blue); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.search { max-width: 320px; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kanban-col {
  flex: 0 0 250px; background: #eef2f5; border-radius: var(--radius); padding: 10px;
  min-height: 120px;
}
.kanban-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 2px 4px 10px; }
.kanban-col.drag-over { outline: 2px dashed var(--blue); }
.opp-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; cursor: grab;
}
.opp-card:hover { border-color: var(--blue); }
.opp-card .t { font-weight: 700; font-size: 14px; }
.opp-card .m { font-size: 13px; color: var(--muted); margin-top: 2px; }
.opp-card .v { font-weight: 700; color: var(--green); margin-top: 4px; font-size: 14px; }
.opp-card select { margin-top: 8px; font-size: 13px; padding: 5px 6px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid var(--green-light); padding: 4px 0 14px 14px; margin-left: 4px; }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .what { font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 24px; }
.detail-grid .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.detail-grid .v { margin-bottom: 10px; }
.empty { color: var(--muted); font-style: italic; padding: 12px 0; }
.error { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.notice { background: var(--green-pale); color: #2c6b3c; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.check { text-decoration: line-through; color: var(--muted); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 35, 50, .55);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50;
}
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; padding: 20px 22px; max-height: 88vh; overflow-y: auto; }
.modal h2 { margin-top: 0; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 30px; width: 100%; max-width: 380px; }
.login-box h1 { font-size: 20px; }
.login-box .brand-sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.login-box .btn { width: 100%; margin-top: 16px; }
