/* Tekton client portal. Service Pro house style (Ink and Electric), quieter: this is a tool people
   come back to, so the type stays calm and the ink is saved for structure. Tokens mirror
   agency/site/assets/site.css :root. */

@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg-dark: #0e1116; --bg-dark-2: #262d38; --on-dark: #fff; --on-dark-muted: #b8bfca;
  --bg-light: #f3f4f6; --bg-light-2: #e3e6eb; --card: #fff;
  --ink: #0e1116; --ink-2: #262d38; --text: #1f252e; --muted: #4a515c;
  --line: #d4d8df; --line-soft: #e8ebef; --line-2: #646b76;
  --accent: #4a85ff; --accent-soft: #a9c4ff; --accent-on-light: #1d56d8; --accent-on-light-hover: #1746b4;
  --good: #1c6e3f; --good-bg: #e1f2e7; --warn: #8a5300; --warn-bg: #fcefd9; --bad: #a3271f; --bad-bg: #fbe3e1;
  --r: 12px; --r-btn: 8px;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-light); color: var(--text); font: 400 16px/1.55 "Geist", system-ui, sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--accent-on-light); font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -0.03em; line-height: 1.1; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 900; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.015em; }
p { margin: 0 0 0.75em; }
:focus-visible { outline: 3px solid var(--accent-on-light); outline-offset: 2px; }

.label { font: 600 0.72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.shell > * { min-width: 0; }
.side { background: var(--bg-dark); color: var(--on-dark-muted); padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-dark); text-decoration: none; padding: 0 6px; }
.brand img { width: 30px; height: 30px; }
.brand b { font-weight: 900; letter-spacing: -0.03em; font-size: 1.05rem; }
.client-name { padding: 0 6px; }
.client-name .label { color: var(--on-dark-muted); }
.client-name strong { display: block; color: var(--on-dark); font-size: 0.98rem; line-height: 1.3; margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--on-dark-muted); text-decoration: none; font-weight: 600; padding: 9px 10px; border-radius: var(--r-btn); }
.nav a:hover { color: var(--on-dark); background: var(--bg-dark-2); }
.nav a[aria-current="page"] { color: var(--on-dark); background: var(--bg-dark-2); box-shadow: inset 3px 0 0 var(--accent); }
.nav .count { font: 700 0.72rem/1 var(--mono); background: var(--accent); color: var(--bg-dark); border-radius: 99px; padding: 4px 7px; }
.side-foot { margin-top: auto; padding: 0 6px; font-size: 0.85rem; }
.side-foot a { color: var(--accent-soft); }
.side-foot button { background: none; border: 0; color: var(--on-dark-muted); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }

.main { padding: 32px clamp(16px, 4vw, 48px) 80px; max-width: 1180px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head p { margin: 6px 0 0; color: var(--muted); }

.banner { background: var(--warn-bg); color: var(--warn); border-radius: var(--r-btn); padding: 8px 12px; font-size: 0.875rem; font-weight: 600; margin-bottom: 18px; }
.banner.master { background: var(--bg-dark); color: var(--on-dark); }

/* ---------- Building blocks ---------- */
.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)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card.top { border-top: 4px solid var(--ink); }
.card h2 + p, .card h3 + p { margin-top: 6px; }
.section { margin-top: 36px; scroll-margin-top: 20px; }
.section > .section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; color: var(--muted); max-width: 46em; }

.ink-card { background: var(--bg-dark); color: var(--on-dark-muted); border-radius: var(--r); padding: 24px; }
.ink-card h2, .ink-card h3, .ink-card strong { color: var(--on-dark); }
.ink-card .label { color: var(--accent-soft); }
.ink-card a { color: var(--accent-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 0.95rem/1 "Geist", sans-serif; padding: 11px 16px; border-radius: var(--r-btn); border: 2px solid var(--accent-on-light); background: var(--accent-on-light); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-on-light-hover); border-color: var(--accent-on-light-hover); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: rgba(14, 17, 22, 0.07); color: var(--ink); }
.btn.small { padding: 7px 11px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.ink-card .btn { background: var(--accent); border-color: var(--accent); color: var(--bg-dark); }
.ink-card .btn.ghost { background: transparent; color: var(--on-dark); border-color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.chip { display: inline-block; font: 600 0.72rem/1 var(--mono); padding: 5px 7px; border-radius: 6px; background: var(--bg-light-2); color: var(--ink); white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.ink { background: var(--ink); color: #fff; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label.f { display: grid; gap: 6px; font-weight: 700; color: var(--ink); font-size: 0.92rem; }
label.f small { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], input[type="password"], select, textarea {
  width: 100%; font: 400 1rem/1.4 "Geist", sans-serif; color: var(--text); background: #fff; border: 2px solid var(--line); border-radius: var(--r-btn); padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-on-light); outline: none; }
textarea { min-height: 96px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 700; color: var(--ink); font-size: 0.92rem; margin-bottom: 6px; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 0.9rem; background: #fff; }
.choices input { accent-color: var(--accent-on-light); }
.choices label:has(input:checked) { border-color: var(--ink); background: var(--bg-light-2); }

.drop { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 22px; text-align: center; background: var(--bg-light); cursor: pointer; }
.drop.over { border-color: var(--accent-on-light); background: #e9f0ff; }
.drop input { display: none; }
.filelist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.filelist li { display: flex; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 0.875rem; }
.filelist button { border: 0; background: none; color: var(--bad); cursor: pointer; font: inherit; }

/* ---------- Home ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps a { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-radius: var(--r-btn); color: var(--text); text-decoration: none; font-weight: 600; }
.steps a:hover { background: var(--bg-light); }
.tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; }
.done .tick { background: var(--good); border-color: var(--good); }
.done .tick::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.done span.t { color: var(--muted); text-decoration: line-through; }
.progress { height: 8px; background: var(--bg-light-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent-on-light); border-radius: 99px; }

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.jump a { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px 6px 6px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.jump a:hover { border-color: var(--ink); }
.jump .tick { width: 18px; height: 18px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.timeline li { display: grid; gap: 4px; border-top: 4px solid var(--line); padding-top: 10px; }
.timeline li.done { border-top-color: var(--good); }
.timeline li.now { border-top-color: var(--accent-on-light); }
.timeline li.now .label { color: var(--accent-on-light); }

/* ---------- Stats ---------- */
.kpi .num { font-size: 2rem; font-weight: 900; letter-spacing: -0.04em; color: var(--ink); line-height: 1.05; margin: 8px 0 6px; }
.kpi .sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.kpi svg { margin-top: 10px; width: 100%; height: 34px; }
.src { font: 500 0.68rem/1.3 var(--mono); color: var(--muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 500 11px "Geist Mono", monospace; fill: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(120px, 190px) 1fr auto; gap: 10px; align-items: center; font-size: 0.9rem; }
.bar .track { height: 10px; background: var(--bg-light-2); border-radius: 99px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.bar b { font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font: 600 0.7rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0 8px 8px; border-bottom: 2px solid var(--ink); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }
.tabs { display: inline-flex; gap: 4px; background: var(--bg-light-2); border-radius: 99px; padding: 4px; }
.tabs button { border: 0; background: none; font: 700 0.85rem/1 "Geist", sans-serif; padding: 8px 12px; border-radius: 99px; cursor: pointer; color: var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.goal { display: grid; gap: 6px; }
.goal .row { justify-content: space-between; }

/* ---------- Website decisions ---------- */
.decision { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; }
.decision .shot { background: var(--bg-light-2); border-right: 1px solid var(--line); position: relative; min-height: 240px; overflow: hidden; }
.decision .shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; cursor: zoom-in; }
.decision .body { padding: 20px; display: grid; gap: 10px; align-content: start; }
.decision dl { margin: 0; display: grid; gap: 8px; }
.decision dt { font: 600 0.7rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.decision dd { margin: 0; }
.decision .ask { font-weight: 700; color: var(--ink); }
.decided { border-left: 4px solid var(--good); }
.decided.change { border-left-color: var(--warn); }

/* ---------- Account access ---------- */
.card.access { background: var(--bg-light); }
.card.access.settled { background: #fff; border-color: var(--line-soft); }
.how { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.how summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 0.92rem; }
.how ol { margin: 10px 0 12px; padding-left: 20px; display: grid; gap: 4px; }
.note-good { background: var(--good-bg); color: var(--good); border-radius: var(--r-btn); padding: 8px 12px; margin: 10px 0 0; font-weight: 600; }
.note-warn { background: var(--warn-bg); color: var(--warn); border-radius: var(--r-btn); padding: 8px 12px; margin: 10px 0 0; font-weight: 600; }
.note-warn a { color: var(--warn); }
input.small-input { font-size: 0.9rem; padding: 8px 10px; }

/* ---------- Items / threads ---------- */
.items { display: grid; gap: 10px; }
.item { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.item summary::-webkit-details-marker { display: none; }
.item .meta { font-size: 0.82rem; color: var(--muted); }
.item .fields { margin: 12px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 0.9rem; }
.item .fields dt { color: var(--muted); }
.item .fields dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread { margin-top: 12px; display: grid; gap: 8px; }
.msg { background: var(--bg-light); border-radius: var(--r-btn); padding: 8px 12px; font-size: 0.92rem; }
.msg.tekton { background: #e9f0ff; }
.msg .who { font: 600 0.7rem/1.2 var(--mono); text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.reply { display: flex; gap: 8px; margin-top: 10px; }
.reply input { flex: 1; }

.lead-type { font: 700 0.7rem/1 var(--mono); text-transform: uppercase; }
.outcome select { padding: 6px 8px; font-size: 0.85rem; width: auto; }
.outcome input { padding: 6px 8px; font-size: 0.85rem; width: 90px; }

.empty { color: var(--muted); padding: 18px; text-align: center; border: 2px dashed var(--line); border-radius: var(--r); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-btn); font-weight: 600; z-index: 50; max-width: calc(100% - 32px); }
.toast.err { background: var(--bad); }
.lightbox { position: fixed; inset: 0; background: rgba(14, 17, 22, 0.86); display: grid; place-items: center; padding: 24px; z-index: 60; cursor: zoom-out; }
.lightbox img { max-height: 92vh; width: auto; border-radius: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--ink); }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* ---------- Sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--bg-dark); padding: 24px 16px; }
.login .box { width: 100%; max-width: 400px; background: #fff; border-radius: var(--r); padding: 28px; }
.login .brand { color: var(--ink); padding: 0; margin-bottom: 22px; }
.login h1 { font-size: 1.7rem; }
.login p { color: var(--muted); }
.login .err { color: var(--bad); font-weight: 600; min-height: 1.4em; margin: 10px 0 0; font-size: 0.92rem; }

/* ---------- Print (monthly report) ---------- */
@media print {
  .side, .no-print, .reply, .btn { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { break-inside: avoid; }
}

/* ---------- Small screens ---------- */
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 20; height: auto; padding: 12px 16px; gap: 10px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .client-name, .side-foot { display: none; }
  .section, .card.access { scroll-margin-top: 112px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; width: 100%; min-width: 0; scrollbar-width: none; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision { grid-template-columns: 1fr; }
  .decision .shot { border-right: 0; border-bottom: 1px solid var(--line); min-height: 220px; }
}
@media (max-width: 620px) {
  .main { padding: 20px 16px 64px; }
  .g2, .g3, .g4, .form .two { grid-template-columns: 1fr; }
  .kpi-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .num { font-size: 1.6rem; }
  .bar { grid-template-columns: 1fr auto; }
  .bar .track { grid-column: 1 / -1; grid-row: 2; }
}
