/*
 * Brand tokens, taken from lowcountryaiworkshop.com so the internal tool and
 * the public site read as one business. Names match the site's own custom
 * properties rather than being reinterpreted, so a change there is a
 * find-and-replace here.
 *
 *   navy #1F3B4D · gold #C8963E · teal #2E7D6B · cream #F6F3EC
 *   Fraunces for headings, Inter for everything else.
 */
:root {
  --navy: #1F3B4D;
  --navy-dark: #132631;
  --navy-tint: #2A4C63;
  --gold: #C8963E;
  --gold-dark: #9C7127;
  --gold-light: #F7ECDA;
  --teal: #2E7D6B;
  --teal-light: #E1EFEC;
  --cream: #F6F3EC;
  --charcoal: #2B2B2B;

  --bg: var(--cream);
  --surface: #FBF8F2;
  --surface-raised: #FFFFFF;
  --border: #E3DFD5;
  --text: var(--charcoal);
  --text-muted: #6B6B66;
  --accent: var(--navy);
  --accent-contrast: #FFFFFF;
  --danger: #A33A22;
  --success: var(--teal);
  --warning: var(--gold-dark);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 59, 77, 0.06);

  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/*
 * Dark mode keeps the same brand rather than inverting to a generic grey:
 * navy deepens into the background, gold and teal stay recognisable.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1D26;
    --surface: #14262F;
    --surface-raised: #1A2F3A;
    --border: #26414E;
    --text: #ECE7DC;
    --text-muted: #9AA8AF;
    --accent: #7FB2C8;
    --accent-contrast: #0E1D26;
    --danger: #E08267;
    --success: #5FBFA6;
    --warning: var(--gold);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Fraunces is a variable serif; the optical size axis keeps headings from
   looking spindly at small sizes. */
h1, h2, h3, .nav__brand, .stat__value, .tile__title {
  font-family: var(--font-heading);
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 32;
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
main.container { padding-top: 28px; padding-bottom: 64px; }

/* Navigation ------------------------------------------------------------- */

.nav { background: var(--surface); border-bottom: 1px solid var(--border); }

.nav__inner { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.nav__brand { font-size: 17px; color: var(--navy); letter-spacing: -0.02em; }
.nav__links { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav__end { margin-left: auto; }

.nav__link { padding: 6px 10px; border-radius: var(--radius); color: var(--text-muted); font-weight: 500; }
.nav__link:hover { background: var(--bg); text-decoration: none; }
.nav__link--active { color: var(--text); background: var(--bg); }

/* Page furniture --------------------------------------------------------- */

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}

.page-head h1 { margin: 0; font-size: 27px; letter-spacing: -0.02em; }
.page-head__sub {
  margin: 6px 0 0; color: var(--text-muted);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.page-head__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.blank-slate { color: var(--text-muted); padding: 24px 0; text-align: center; }
.prose { max-width: 70ch; }
.link { color: var(--accent); }
.is-overdue-text { color: var(--danger); }

/* Flash ------------------------------------------------------------------ */

.flash {
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 20px;
  border: 1px solid var(--border); background: var(--surface);
}
.flash--notice { border-left: 3px solid var(--success); }
.flash--alert { border-left: 3px solid var(--danger); }

/* Stats ------------------------------------------------------------------ */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}

.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 4px;
}

.stat--alert { border-color: var(--danger); }
.stat--alert .stat__value { color: var(--danger); }
.stat__label { color: var(--text-muted); font-size: 13px; }
.stat__value { font-size: 26px; font-weight: 620; letter-spacing: -0.02em; }
.stat__note { color: var(--text-muted); font-size: 12px; }

/* Cards ------------------------------------------------------------------ */

.columns {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px; margin-bottom: 20px;
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}

.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card__head h2 { margin: 0; font-size: 16px; }
.card__subhead { font-size: 14px; margin: 20px 0 10px; color: var(--text-muted); }
.card__meta { color: var(--text-muted); font-size: 13px; }

/* Tables ----------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; }

.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 600; padding: 8px 10px;
}

.table td { padding: 10px; border-top: 1px solid var(--border); vertical-align: top; }

.table--bordered {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.table tbody tr:hover { background: var(--bg); }
.table__meta { color: var(--text-muted); font-size: 13px; }
.table__number { text-align: right; font-variant-numeric: tabular-nums; }
.table__actions { text-align: right; white-space: nowrap; }
.table tr.is-overdue td:first-child { box-shadow: inset 2px 0 0 var(--danger); }

/* Definition lists ------------------------------------------------------- */

.details { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; margin: 0; }
.details dt { color: var(--text-muted); font-size: 13px; }
.details dd { margin: 0; }

/* Badges and chips ------------------------------------------------------- */

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  font-weight: 550; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}

.badge--won, .badge--qualified { color: var(--success); border-color: currentColor; }
.badge--lost, .badge--urgent, .badge--do-not-contact { color: var(--danger); border-color: currentColor; }
.badge--high, .badge--task { color: var(--warning); border-color: currentColor; }
.badge--imported { color: var(--accent); border-color: currentColor; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 20px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 13px;
}

.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.chip--active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.chip__count { font-variant-numeric: tabular-nums; opacity: 0.7; }

/* Board ------------------------------------------------------------------ */

.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr);
  gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start;
}

.board__column {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 120px;
}

.board__column--over { border-color: var(--accent); background: var(--bg); }

.board__head {
  display: flex; align-items: center; gap: 8px; padding: 12px;
  border-bottom: 1px solid var(--border);
}

.board__head h2 { margin: 0; font-size: 13px; font-weight: 600; }
.board__count {
  margin-left: auto; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.board__probability { font-size: 11px; color: var(--text-muted); }

.board__cards { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 60px; }

.board__card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); padding: 10px; display: flex; flex-direction: column; gap: 6px;
}

.board--drag-enabled .board__card { cursor: grab; }
.board__card--dragging { opacity: 0.45; }
.board__title { font-weight: 550; }
.board__meta, .board__due { font-size: 12px; color: var(--text-muted); }
.board__row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.board__value { font-variant-numeric: tabular-nums; font-size: 13px; }
.board__empty { color: var(--text-muted); font-size: 13px; text-align: center; margin: 8px 0; }
.board__move { display: flex; gap: 6px; margin: 0; }

/* Dragging is a pointer affordance. Touch keeps the dropdown, which is also
   the accessible route, so it is never hidden — only de-emphasised. */
@media (hover: none) {
  .board--drag-enabled .board__card { cursor: default; }
}

/* Forms ------------------------------------------------------------------ */

.form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; max-width: 960px;
}

.form--inline { padding: 0; border: none; background: none; }

.form__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--text-muted); font-weight: 550; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field--check { flex-direction: row; align-items: center; gap: 8px; }
.field--check label { font-weight: 400; }

.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit;
}

.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.input--tiny { padding: 4px 6px; font-size: 12px; }

.form__actions { display: flex; align-items: center; gap: 16px; }

.form__errors {
  border: 1px solid var(--danger); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 20px;
}

.form__errors h2 { font-size: 14px; margin: 0 0 8px; color: var(--danger); }
.form__errors ul { margin: 0; padding-left: 18px; }

.filters__form { display: flex; gap: 8px; margin-bottom: 20px; }
.filters__form .input { max-width: 340px; }

.log-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.log-forms__panel .card__subhead { margin-top: 0; }

/* Buttons ---------------------------------------------------------------- */

.button {
  display: inline-block; padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-contrast);
  font: inherit; font-weight: 550; cursor: pointer;
}

.button:hover { text-decoration: none; filter: brightness(1.08); }
.button--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.button--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button--tiny { padding: 4px 8px; font-size: 12px; }

/* button_to renders a form; keep them inline with their neighbours. */
.page-head__actions form, .table__actions form, .nav__end form { display: inline-block; margin: 0; }

/* Timeline --------------------------------------------------------------- */

.timeline { list-style: none; margin: 20px 0 0; padding: 0; }

.timeline__entry {
  display: grid; grid-template-columns: 150px 110px 1fr; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--border);
}

.timeline__when { color: var(--text-muted); font-size: 13px; }
.timeline__body p { margin: 0 0 4px; }

/* Sign in ---------------------------------------------------------------- */

.session { max-width: 380px; margin: 12vh auto 0; }
.session h1 { font-size: 22px; margin: 0 0 6px; }

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .timeline__entry { grid-template-columns: 1fr; gap: 2px; }
  .details { grid-template-columns: 1fr; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; }
}

/* Rainmaker -------------------------------------------------------------- */

/*
 * The four fit verdicts are colour-coded by kind, not by good-to-bad.
 * "Not enough found" is not a worse answer than "not a fit" — it is a
 * different one — so it gets its own neutral tone rather than a warmer red.
 */
.badge--worth { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.badge--conversation { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge--unknown { background: color-mix(in srgb, var(--text-muted) 16%, transparent); color: var(--text-muted); }
.badge--no { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.badge--ready { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.badge--blocked { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.badge--follow-up { background: color-mix(in srgb, var(--text-muted) 14%, transparent); color: var(--text-muted); }

.card--warn { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }

/* Hints sit under a field and explain why the rule exists, not just what it is. */
.field__hint { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.plain-list { list-style: none; margin: 8px 0 0; padding: 0; }
.plain-list li { padding: 5px 0; border-top: 1px solid var(--border); }
.plain-list li:first-child { border-top: 0; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.columns--wide-first { grid-template-columns: 1.35fr 1fr; }

/* The draft reads as an email, so newlines survive and the width stays sane. */
.email-body {
  margin-top: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); white-space: pre-wrap; line-height: 1.6; max-width: 68ch;
}

/*
 * An unfilled slot has to be impossible to skim past — it is the one thing
 * standing between a form letter and an email worth sending.
 */
mark.bracket {
  background: color-mix(in srgb, var(--warning) 22%, transparent);
  color: var(--text); padding: 1px 3px; border-radius: 3px; font-weight: 550;
}

.input--mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; }

details.card > summary { cursor: pointer; color: var(--text-muted); font-size: 14px; }

@media (max-width: 720px) {
  .columns--wide-first { grid-template-columns: 1fr; }
}

/* Department tiles ------------------------------------------------------- */

/*
 * The front door. Each tile is one department of the business, with the one
 * number that says whether it needs you today — not a decorative icon grid.
 * A department that is not built yet says so rather than being hidden, so the
 * shape of the whole system is visible from the first screen.
 */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; margin-bottom: 32px;
}

.tile {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: var(--text);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

a.tile:hover {
  text-decoration: none; border-color: var(--gold);
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31, 59, 77, 0.10);
}

/* A gold spine on the left, the one place the accent colour earns its keep. */
.tile::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  border-radius: var(--radius) 0 0 var(--radius); background: var(--gold);
  opacity: 0; transition: opacity 120ms ease;
}
a.tile:hover::before { opacity: 1; }

.tile__eyebrow {
  font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--gold-dark); font-weight: 600;
}
.tile__title { font-size: 19px; margin: 0; }
.tile__body { color: var(--text-muted); font-size: 14px; margin: 0; flex: 1; }

.tile__metrics { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.tile__metric { display: flex; flex-direction: column; }
.tile__number { font-family: var(--font-heading); font-size: 22px; font-weight: 600; line-height: 1.1; }
.tile__caption { font-size: 12px; color: var(--text-muted); }

.tile--attention { border-color: var(--gold); background: var(--gold-light); }
.tile--attention .tile__number { color: var(--gold-dark); }
.tile--soon { opacity: 0.72; }
.tile--soon .tile__number { color: var(--text-muted); }

@media (prefers-color-scheme: dark) {
  .tile--attention { background: rgba(200, 150, 62, 0.10); }
}

/* Buttons pick up the brand rather than a generic blue. */
.button { font-family: var(--font-body); font-weight: 550; }
.button:not(.button--ghost):not(.button--danger) { background: var(--navy); border-color: var(--navy); }
.button:not(.button--ghost):not(.button--danger):hover { background: var(--navy-tint); border-color: var(--navy-tint); }

.chip--active { border-color: var(--navy); }
