/* RaceLine CRM — no build step required */
/* RaceLine IT brand — colours and fonts match racelineit.com */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(../brand/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(../brand/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(../brand/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url(../brand/barlow-semi-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url(../brand/barlow-semi-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url(../brand/barlow-semi-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
  /* brand palette */
  --brand: #00968f; --brand-light: #2ec4b6; --signal: #00766f; --signal-dark: #005c56;
  --mint: #d9efee; --mint-pale: #eef7f6; --tarmac: #1c2b30; --tarmac-2: #26383e;
  --display: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;

  --bg: #f3f8f7; --panel: #fff; --ink: #142226; --muted: #5a6a70; --line: #d3e3e1;
  --nav: var(--tarmac); --nav-ink: #c9d6da; --accent: var(--brand); --accent-ink: #fff;
  --blue: var(--signal); --green: var(--signal-dark); --amber: #6b5413; --red: #b8322a;
  --green-bg: var(--mint); --amber-bg: #fdf1d6; --red-bg: #fbe4e2; --blue-bg: #e3eef0; --grey-bg: #e8eff0;
  --radius: 8px; --shadow: 0 1px 2px rgba(20,34,38,.06);
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--body); background: var(--bg); color: var(--ink); line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-family: var(--display); font-weight: 700; font-size: 1.75rem; margin: 0; letter-spacing: .005em; }
h2 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; margin: 0 0 .75rem; letter-spacing: .01em; }
h3 { font-family: var(--display); font-weight: 600; font-size: 1.05rem; margin: 0 0 .5rem; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.nav { background: var(--nav); color: var(--nav-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.nav a.brand, .brand { display: block; border-radius: 0; padding: 4px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--tarmac-2); color: #fff; }
.nav a.brand:hover { background: none; }
.brand img { display: block; width: 100%; max-width: 188px; height: auto; }
.brand-app { display: inline-block; margin-top: 8px; font-family: var(--display); font-weight: 600; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--brand-light); }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--nav-ink); padding: 8px 10px; border-radius: 6px; margin-bottom: 2px; }
.nav a:hover { background: var(--tarmac-2); text-decoration: none; color: #fff; }
.nav a.active { background: var(--tarmac-2); color: #fff; box-shadow: inset 3px 0 0 var(--brand-light); }
.nav a span[aria-hidden] { width: 18px; text-align: center; color: var(--brand-light); }
.nav .badge { margin-left: auto; }
.nav-foot { margin-top: auto; font-size: .8rem; padding: 10px 10px 0; border-top: 1px solid var(--tarmac-2); }
.nav-foot button { background: none; border: 0; color: var(--nav-ink); padding: 0; cursor: pointer; font: inherit; }
.main { min-width: 0; }
.topbar { box-shadow: inset 0 3px 0 var(--brand); display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar form { flex: 1; max-width: 460px; }
.topbar input { width: 100%; }
.content { padding: 24px 28px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Panels & grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .right { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .split, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .nav { position: static; height: auto; } .g2, .g4 { grid-template-columns: 1fr; } .content { padding: 16px; } }

.stat { padding: 16px 18px; }
.stat .label { font-family: var(--display); font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-family: var(--display); font-size: 1.85rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value.red { color: var(--red); }
.stat .sub { color: var(--muted); font-size: .85rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-family: var(--display); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--mint-pale); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--mint-pale); }
.card table th:first-child, .card table td:first-child { padding-left: 18px; }
.card table th:last-child, .card table td:last-child { padding-right: 18px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Forms */
input, select, textarea { font: inherit; color: inherit; border: 1px solid #b9c9cb; border-radius: 6px; padding: 7px 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); border-color: var(--brand); }
input[type=checkbox] { width: auto; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > * { width: auto; }
.error { color: var(--red); font-size: .8rem; margin-top: 3px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #b9c9cb; background: #fff; color: var(--ink); padding: 7px 13px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--mint-pale); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--signal); border-color: var(--signal); }
.btn.xero { background: #13b5ea; border-color: #13b5ea; color: #fff; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: .85rem; }
.btn.link { border: 0; background: none; color: var(--blue); padding: 0; font-weight: 500; }
form.inline-form { display: inline; }

/* Badges & alerts */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--grey-bg); color: #3d4655; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.xero { background: #e1f6fd; color: #0b7fa6; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; border: 1px solid; }
.alert.ok { background: var(--mint); border-color: #a9d8d5; color: var(--signal-dark); }
.alert.err { background: var(--red-bg); border-color: #efc3bf; color: #8a1c1c; }
.alert.warn { background: var(--amber-bg); border-color: #efd9a0; color: #6b5413; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { font-family: var(--display); font-size: 1rem; padding: 9px 11px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Definition list */
dl.props { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; overflow-wrap: anywhere; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-bg); font-size: .9rem; }
.tl-icon.call { background: var(--blue-bg); } .tl-icon.email { background: var(--amber-bg); } .tl-icon.meeting { background: var(--green-bg); }
.tl-body p { margin: 4px 0 0; white-space: pre-wrap; }
.tl-meta { color: var(--muted); font-size: .8rem; }

/* Pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: #e3eded; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col.won { background: var(--mint); } .col.lost { background: #f3e5e4; }
.col-head { display: flex; justify-content: space-between; font-family: var(--display); font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.col-sub { color: var(--muted); font-size: .8rem; margin-bottom: 10px; }
.col-body { min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.col-body.over { outline: 2px dashed var(--blue); outline-offset: 2px; border-radius: 6px; }
.deal { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px; cursor: grab; box-shadow: var(--shadow); }
.deal.dragging { opacity: .5; }
.deal-title { font-weight: 600; }
.deal-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: .85rem; color: var(--muted); }

/* Quote lines */
.lines td { padding: 6px; }
.lines input, .lines select, .lines textarea { padding: 5px 7px; }
.lines textarea { min-height: 38px; }
.totals { margin-left: auto; width: 300px; }
.totals td { border: 0; padding: 4px 0; }
.totals tr.grand td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--ink); padding-top: 8px; }

.pagination { display: flex; gap: 4px; padding: 12px 18px; align-items: center; }
.pagination a, .pagination span { padding: 4px 10px; border-radius: 5px; border: 1px solid var(--line); background: #fff; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--ink); }
.pagination .disabled { color: var(--muted); }

details summary { cursor: pointer; font-weight: 600; }
.task-done { text-decoration: line-through; color: var(--muted); }
.overdue { color: var(--red); font-weight: 600; }
.bar { height: 8px; background: var(--grey-bg); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--tarmac) 0%, var(--tarmac-2) 60%, var(--signal-dark) 100%); padding: 20px; }
.login-card { width: 380px; max-width: 100%; border-top: 4px solid var(--brand); padding: 28px; }
.login-logo { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 6px; }
.login-sub { text-align: center; font-family: var(--display); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-size: .8rem; margin-bottom: 22px; }
