:root {
--navy: #211d49;
--navy-deep: #17142f;
--gold: #b3a085;
--gold-soft: #c9bca6;
--red: #c8102e;
--white: #ffffff;
--cream: #f7f6f2;
--ink: #211d49;
--muted: #6e6a85;
--line: #e5e2ec;
--bad: #c8102e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
margin: 0;
font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
color: var(--ink);
background: var(--cream);
line-height: 1.6;
font-weight: 400;
}

.wrap { max-width: 100%; margin: 0; padding: 32px 32px; }

/* ---- Wordmark ------------------------------------------------------- */
.wordmark {
font-family: 'Cormorant Garamond', Georgia, serif;
font-weight: 700;
letter-spacing: 0.14em;
color: var(--navy);
line-height: 1;
}
.wordmark .red { color: var(--red); }

.brand-sub {
display: block;
font-family: 'Montserrat', sans-serif;
font-weight: 500;
font-size: 9px;
letter-spacing: 0.3em;
text-transform: uppercase;
color: var(--gold);
margin-top: 4px;
}

/* ---- Top navigation -------------------------------------------------- */
.topnav {
display: flex; align-items: center; gap: 34px;
background: #fff;
border-bottom: 1px solid var(--line);
padding: 16px 28px;
}
.topnav-brand .wordmark { font-size: 24px; }
.topnav-links { display: flex; gap: 6px; flex: 1; }
.nav-link {
font-size: 13px; font-weight: 600;
letter-spacing: 0.07em; text-transform: uppercase;
text-decoration: none; color: var(--muted);
padding: 9px 16px; border-radius: 4px;
transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--navy); background: var(--cream); }
.nav-link.active { color: #fff; background: var(--navy); }

.nav-link.add-lead-btn {
color: #fff;
background: var(--navy);
padding: 9px 18px;
}
.nav-link.add-lead-btn:hover { background: var(--navy-deep); color: #fff; }
.nav-link.add-lead-btn.active { background: var(--gold); color: var(--navy); }

/* ---- Section headings ------------------------------------------------ */
h2 {
font-family: 'Cormorant Garamond', Georgia, serif;
font-size: 26px; font-weight: 600;
text-transform: uppercase; letter-spacing: 0.1em;
color: var(--gold);
margin: 26px 0 14px;
}

label {
display: block; font-size: 11px; font-weight: 600;
letter-spacing: 0.08em; text-transform: uppercase;
color: var(--muted); margin: 14px 0 5px;
}

/* ---- Form field group labels ------------------------------------------ -*/
.field-group-label {
font-size: 11px; font-weight: 600;
letter-spacing: 0.08em; text-transform: uppercase;
color: var(--gold);
border-top: 1px solid var(--line);
margin: 24px 0 4px; padding-top: 16px;
}
.field-group-label:first-of-type { border-top: none; margin-top: 8px; padding-top: 0; }

input, textarea {
width: 100%; padding: 11px 13px;
font-family: 'Montserrat', sans-serif; font-size: 15px;
color: var(--ink);
border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
input:focus, textarea:focus {
outline: none; border-color: var(--navy);
box-shadow: 0 0 0 2px rgba(33, 29, 73, 0.12);
}
textarea { min-height: 70px; resize: vertical; }

/* ---- Buttons ---------------------------------------------------------- */
button {
font-family: 'Montserrat', sans-serif; font-weight: 600;
font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
cursor: pointer;
background: var(--navy); color: #fff; border: none;
padding: 12px 22px; border-radius: 4px;
transition: background 0.15s ease;
}
button:hover { background: var(--navy-deep); }
button.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
button.ghost:hover { background: #fff; border-color: var(--navy); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .row { grid-template-columns: 1fr; } }

/* ---- Add-contact two-column layout ------------------------------------ */
.add-contact-grid {
display: grid;
grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
gap: 32px;
align-items: stretch;
}
.add-contact-notes {
display: flex;
flex-direction: column;
}
.add-contact-notes textarea {
flex: 1;
min-height: 320px;
resize: vertical;
}
.add-contact-fields .field-group-label:first-of-type,
.add-contact-notes .field-group-label:first-of-type {
margin-top: 0;
padding-top: 0;
}
@media (max-width: 900px) {
.add-contact-grid { grid-template-columns: 1fr; }
.add-contact-notes textarea { min-height: 160px; }
}

.status { font-size: 13px; margin: 12px 0; font-weight: 500; }
.status.ok { color: #2f7d5b; }
.status.bad { color: var(--bad); }

.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--bad); font-size: 12px; min-height: 18px; margin: 6px 0 0; }
.actions { display: flex; gap: 11px; align-items: center; margin-top: 16px; }

/* ---- Contacts table ---------------------------------------------------- */
.tbl {
width: 100%; border-collapse: collapse;
background: #fff; border: 1px solid var(--line); border-radius: 4px;
overflow: hidden; font-size: 14px;
}
.tbl th {
text-align: left; font-size: 11px; font-weight: 600;
letter-spacing: 0.08em; text-transform: uppercase;
color: var(--muted); background: var(--cream);
padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fbfaf7; }
.td-strong { font-weight: 600; color: var(--navy); }

/* ---- Stage pills -------------------------------------------------------- */
.pill {
display: inline-block; padding: 3px 11px;
font-size: 11px; font-weight: 600;
letter-spacing: 0.05em; text-transform: uppercase;
border-radius: 99px; white-space: nowrap;
background: var(--cream); color: var(--muted);
border: 1px solid var(--line);
}
.pill-new { background: #eef1f8; color: #3d4a75; border-color: #d5dcee; }
.pill-contacted { background: #f4eee3; color: #8a7350; border-color: #e5d9c3; }
.pill-quoted { background: #f8f1e2; color: #9a7c2e; border-color: #ecdcb4; }
.pill-provisional { background: #f3e9f4; color: #7c4d85; border-color: #e2cde5; }
.pill-confirmed { background: #e7f2ea; color: #2f7d5b; border-color: #cbe4d3; }
.pill-completed { background: #e9e9ef; color: #47456a; border-color: #d3d2e0; }
.pill-lost { background: #f9e8ea; color: var(--red); border-color: #efc9cf; }

/* ---- Pipeline (Kanban) --------------------------------------------------- */
.pipeline-view { padding-bottom: 30px; }
.pipeline-header { padding-bottom: 0; }
.board {
display: flex; gap: 14px; align-items: flex-start;
overflow-x: auto;
padding: 10px 28px 26px;
}
.col {
flex: 0 0 250px; max-width: 250px;
background: #efede7;
border: 1px solid var(--line);
border-radius: 6px;
padding: 10px;
transition: background 0.15s ease, border-color 0.15s ease;
}
.col.drag-over { background: #e7e3d8; border-color: var(--gold); }
.col-head {
display: flex; align-items: center; justify-content: space-between;
font-size: 12px; font-weight: 600;
letter-spacing: 0.07em; text-transform: uppercase;
color: var(--navy);
padding: 4px 6px 10px;
}
.count {
font-size: 11px; font-weight: 600;
background: #fff; color: var(--muted);
border: 1px solid var(--line);
border-radius: 99px; padding: 1px 9px; margin-left: 8px;
}
.col-body { min-height: 40px; display: flex; flex-direction: column; gap: 8px; }
.kcard {
background: #fff;
border: 1px solid var(--line);
border-left: 3px solid var(--gold);
border-radius: 4px;
padding: 11px 13px;
cursor: grab;
box-shadow: 0 1px 2px rgba(33, 29, 73, 0.05);
}
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: 0.55; }
.kcard-name { font-weight: 600; font-size: 14px; color: var(--navy); }
.kcard-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kcard-meta { font-size: 11px; color: var(--muted); margin-top: 5px; }

/* ---- Dashboard ------------------------------------------------------------ */
.stat-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
gap: 14px;
}
.stat {
background: #fff;
border: 1px solid var(--line);
border-left: 3px solid var(--gold);
border-radius: 4px;
padding: 18px 20px;
}
.stat-num {
font-family: 'Cormorant Garamond', Georgia, serif;
font-size: 40px; font-weight: 600; line-height: 1;
color: var(--navy);
}
.stat-lbl {
font-size: 11px; font-weight: 600;
letter-spacing: 0.07em; text-transform: uppercase;
color: var(--muted); margin-top: 7px;
}

/* ---- Login gate ------------------------------------------------------------ */
#gate {
min-height: 100vh; margin: 0;
display: flex; flex-direction: column;
align-items: center; justify-content: center;
text-align: center; background: var(--navy);
padding: 24px;
}
#gate .gate-brand { margin-bottom: 36px; }
#gate .wordmark { font-size: 58px; color: var(--gold); }
#gate .wordmark .red { color: var(--red); }
#gate .brand-sub { color: var(--gold-soft); font-size: 11px; letter-spacing: 0.4em; margin-top: 10px; }
#gate label { color: var(--gold-soft); }
#gate input {
max-width: 260px; text-align: center; letter-spacing: 0.4em;
font-size: 20px; background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.25); color: #fff;
}
#gate input::placeholder { color: rgba(255, 255, 255, 0.35); }
#gate input:focus {
border-color: var(--gold);
box-shadow: 0 0 0 2px rgba(179, 160, 133, 0.25);
}
#gate .actions { justify-content: center; margin-top: 18px; }
#gate button { background: var(--gold); color: var(--navy); }
#gate button:hover { background: var(--gold-soft); }
#gate .error { color: #f3b4bc; }
