/* Understudy CRM. The Understudy palette: bone page, forest header, brass accent.
   --brand is a FILL colour only. Accent text uses --brand-text, which is a
   deeper brass that stays readable on the bone background. */

:root {
  --bg: #F4EFE3;
  --ink: #1E2C27;
  --ink-2: #2E3D37;
  --mute: #5E6A63;
  --line: #DDD4C0;
  --edge: #C9BEA5;
  --surface: #ECE4D3;
  --white: #FBF7EE;

  --forest: #16302A;
  --onforest: #EFEADD;
  --gold: #D8AC54;

  --brand: #16302A;
  --brand-mark: #A8792E;
  --brand-text: #86601F;
  --brand-tint: #F3E9D2;
  --on-brand: #EFEADD;

  --danger: #B4533C;
  --danger-tint: #F6E3DC;
  --ok: #3F7D5E;
  --ok-tint: #E3EDE4;
  --warn: #C27A14;
  --radius: 7px;

  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink-2);
  background: var(--bg);
  line-height: 1.55;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); letter-spacing: -0.015em; line-height: 1.2; }
h1, h2 { font-family: var(--display); font-weight: 500; }
h1 { font-size: 25px; margin-bottom: 4px; }
h2 { font-size: 17px; margin-bottom: 10px; }
h3 { font-size: 14.5px; }
a { color: var(--brand-text); }
a:hover { color: var(--ink); }

.wrap { max-width: 1180px; margin-inline: auto; padding: 24px 24px 60px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }

/* ---------- nav ---------- */
.topbar {
  display: flex; align-items: center; gap: 26px;
  border-bottom: 1px solid var(--forest); background: var(--forest);
  padding: 0 24px; height: 52px; position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
.brand { font-family: var(--display); font-weight: 500; font-size: 19px; color: var(--onforest); text-decoration: none; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 8px; }
.brand:hover { color: var(--onforest); }
.brand img { width: 20px; height: 20px; }
.brand em { font-family: var(--sans); font-style: normal; color: var(--gold); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.topbar .links { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar .links a { color: var(--onforest); opacity: .82; text-decoration: none; font-size: 13.5px; }
.topbar .links a:hover { opacity: 1; color: var(--onforest); }
.topbar .links a.on { color: var(--gold); opacity: 1; font-weight: 600; }

/* ---------- flash ---------- */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13.5px; }
.flash--ok { background: var(--ok-tint); color: var(--ok); border: 1px solid #C5D9CB; }
.flash--error { background: var(--danger-tint); color: var(--danger); border: 1px solid #E8C4B8; }

/* ---------- cards / panels ---------- */
.panel { border: 1px solid var(--line); border-radius: 9px; background: var(--white); margin-bottom: 22px; }
.panel > h2 { padding: 13px 16px; border-bottom: 1px solid var(--line); margin: 0; background: var(--surface); border-radius: 9px 9px 0 0; }
.panel .body { padding: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-bottom: 22px; }
.stats > div { background: var(--white); padding: 14px 16px; }
.stats dt { font-size: 22px; font-weight: 600; color: var(--ink); font-family: var(--mono); }
.stats dd { font-size: 11.5px; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); font-weight: 600; background: var(--surface); }
tbody tr:hover { background: var(--surface); }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* ---------- badges ---------- */
.badge { display: inline-block; font-family: var(--sans); font-size: 10.5px; padding: 2px 7px; border-radius: 20px; font-weight: 600; letter-spacing: .03em; white-space: nowrap; }
.badge--t1 { background: var(--brand-tint); color: var(--brand-text); }
.badge--t2 { background: var(--surface); color: var(--ink-2); border: 1px solid var(--edge); }
.badge--t3 { background: var(--surface); color: var(--mute); border: 1px solid var(--line); }
.badge--ok { background: var(--ok-tint); color: var(--ok); }
.badge--warn { background: var(--brand-tint); color: var(--brand-text); }
.badge--danger { background: var(--danger-tint); color: var(--danger); }
.badge--plain { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }

/* Confidence is shown wherever a name is shown. */
.conf { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.conf--High { background: var(--ok-tint); color: var(--ok); }
.conf--Medium-high { background: var(--surface); color: var(--ink-2); }
.conf--Medium { background: var(--brand-tint); color: var(--brand-text); }
.conf--Low { background: var(--danger-tint); color: var(--danger); }

/* do_not_contact must be visually unmistakable. */
.dnc {
  background: repeating-linear-gradient(45deg, var(--danger-tint), var(--danger-tint) 8px, var(--white) 8px, var(--white) 16px);
  border-left: 4px solid var(--danger) !important;
}
.dnc .name { text-decoration: line-through; color: var(--danger); }
.dnc-flag { background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 3px; letter-spacing: .05em; }

/* A gap row is an open question, not a blank waiting for a guess. */
.gap { background: var(--brand-tint); border-left: 4px solid var(--brand-mark) !important; }
.gap .question { color: var(--ink); font-style: italic; }
.gap-flag { background: var(--brand-mark); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 3px; letter-spacing: .05em; }

/* ---------- today ---------- */
.action { border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; margin-bottom: 10px; display: grid; grid-template-columns: 46px 1fr; gap: 14px; }
.action--1 { border-left: 4px solid var(--brand-mark); }
.action .score { font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--brand-text); text-align: center; }
.action .score small { display: block; font-size: 9.5px; color: var(--mute); font-weight: 400; letter-spacing: .05em; }
.action .why { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.action .hook { background: var(--brand-tint); border-left: 3px solid var(--brand-mark); padding: 8px 12px; margin-top: 8px; font-size: 13px; color: var(--ink); border-radius: 0 4px 4px 0; }
.action .detail { font-size: 12.5px; color: var(--mute); margin-top: 6px; }

/* ---------- forms ---------- */
form.stack { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-weight: 600; display: block; margin-bottom: 3px; }
label .req { color: var(--danger); }
input[type=text], input[type=date], input[type=datetime-local], input[type=number],
input[type=email], input[type=url], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--white);
}
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-mark); outline-offset: 1px; border-color: transparent; }

.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; font-weight: 600; font-size: 13.5px; border: 1px solid transparent; cursor: pointer; font-family: inherit; text-decoration: none; }
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: #0F241F; color: var(--on-brand); }
.btn--ghost { border-color: var(--edge); color: var(--ink); background: var(--white); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { padding: 5px 11px; font-size: 12.5px; }

details.adder > summary { cursor: pointer; font-size: 13px; color: var(--brand-text); font-weight: 600; padding: 10px 0; list-style: none; }
details.adder > summary::-webkit-details-marker { display: none; }
details.adder > summary::before { content: "+ "; font-weight: 700; }
details.adder[open] > summary::before { content: "- "; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters > div { min-width: 130px; }

.evidence { font-family: var(--mono); font-size: 12px; background: var(--surface); border: 1px solid var(--line); padding: 3px 7px; border-radius: 4px; display: inline-block; word-break: break-word; }

.foot { border-top: 1px solid var(--line); padding: 18px 24px; color: var(--mute); font-size: 11.5px; text-align: center; }

.empty { padding: 22px; text-align: center; color: var(--mute); font-size: 13.5px; }
.note-box { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 12px 14px; font-size: 13px; }

ul.bullets { margin: 0 0 0 18px; }
ul.bullets li { margin-bottom: 6px; font-size: 13px; }

@media (max-width: 700px) {
  .topbar { height: auto; padding-block: 10px; }
  .action { grid-template-columns: 1fr; }
  table { font-size: 12.5px; }
}

/* "Can I act on this today?" A named primary contact is the difference
   between an account you can write to and one that needs research first. */
.star { color: var(--brand-mark); font-size: 15px; line-height: 1; }
.star--off { color: var(--line); }

/* The way-in editor. Collapsed by default so the list stays scannable. These
   fields are entered by hand from LinkedIn, and entering one is quicker than
   writing a paragraph nothing can sort on. */
.wayin-cell { min-width: 190px; }
.wayin > summary { cursor: pointer; font-size: 11.5px; color: var(--brand-text); font-weight: 600; margin-top: 6px; list-style: none; }
.wayin > summary::-webkit-details-marker { display: none; }
.wayin > summary::before { content: "✎ "; }
.wayin[open] > summary { margin-bottom: 8px; }
.wayin-form { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 11px; }
.wayin-form .row { grid-template-columns: 1fr; }
@media (min-width: 900px) { .wayin-form { min-width: 320px; } }

/* Who is signed in. With several people writing to the same records, the
   answer to "who am I right now" should never require thinking about it. */
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.topbar .who a { color: var(--onforest); opacity: .82; text-decoration: none; }
.topbar .who a:hover { opacity: 1; }
.topbar .who .me { font-weight: 600; color: var(--onforest); }
.byline { font-size: 11px; color: var(--mute); }
.byline strong { color: var(--ink-2); font-weight: 600; }

/* Ownership. With several people on one list, the expensive mistake is two
   approaches to the same person in the same week. So who is working an
   account belongs at the top of its page. */
.ownerstrip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
              margin-top: 14px; padding: 10px 14px; background: var(--surface);
              border: 1px solid var(--line); border-radius: 8px; }

/* Mine vs everyone. Two people is enough for "is that mine or his?" to become
   the first question asked of any list, so it gets a control rather than a
   mental filter. Hidden entirely while there is only one person. */
.scopes { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.scope { font-size: 13px; padding: 5px 12px; border-radius: 20px; text-decoration: none;
         border: 1px solid var(--line); color: var(--ink-2); background: var(--white); }
.scope:hover { border-color: var(--ink); color: var(--ink); }
.scope.on { background: var(--brand-tint); border-color: var(--brand-mark); color: var(--brand-text); font-weight: 600; }


/* Filter forms that submit themselves (static/filters.js). The class is added
   by the script, so with no JavaScript the button stays visible and the form
   keeps working exactly as it did. */
.filters--auto .filters__submit { display: none; }


/* "Find this person on LinkedIn". A link, never automation: it opens a search
   or the recorded profile in a new tab and reads nothing. Deliberately small
   and quiet, because it sits on every contact row. */
.li-find {
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  text-decoration: none; vertical-align: 2px;
  color: var(--mute); border: 1px solid var(--line); border-radius: 3px;
  padding: 0 4px; margin-left: 4px;
}
.li-find:hover { color: var(--brand-text); border-color: var(--brand-mark); }


/* Local test sign-in. Shown on every page while it is on, so it can never be
   mistaken for the real thing. */
.devmark { background: var(--warn); color: #fff; font-size: 12px; font-weight: 600;
           letter-spacing: .04em; text-align: center; padding: 4px 10px; }
