/* JC360 CRM — reuses the site's warm-stone + brand-orange system.
   Same rule as the marketing site: --brand is a FILL colour only (2.13:1 on
   white). Orange text uses --brand-text. */

:root {
  --ink: #1C1917;
  --ink-2: #44403C;
  --mute: #78716C;
  --line: #E7E5E4;
  --surface: #FAFAF9;
  --white: #FFFFFF;

  --brand: #FF9933;
  --brand-mark: #E07400;
  --brand-text: #B45309;
  --brand-tint: #FFF4E6;
  --on-brand: #1C1917;

  --danger: #B91C1C;
  --danger-tint: #FEF2F2;
  --ok: #15803D;
  --ok-tint: #F0FDF4;

  --sans: 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(--white);
  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 { 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(--line); background: var(--surface);
  padding: 0 24px; height: 52px; position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.03em; }
.brand span { color: var(--brand-mark); }
.brand em { font-style: normal; color: var(--mute); font-weight: 600; font-size: 12px; }
.topbar .links { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar .links a { color: var(--ink-2); text-decoration: none; font-size: 13.5px; }
.topbar .links a.on { color: var(--brand-text); 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 #BBF7D0; }
.flash--error { background: var(--danger-tint); color: var(--danger); border: 1px solid #FECACA; }

/* ---------- 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-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: #EFF6FF; color: #1D4ED8; }
.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 (SPEC §3.5). */
.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: #EFF6FF; color: #1D4ED8; }
.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 (SPEC §3.3). */
.dnc {
  background: repeating-linear-gradient(45deg, var(--danger-tint), var(--danger-tint) 8px, #FFF 8px, #FFF 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 (SPEC §3.4). */
.gap { background: #FFFBEB; 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: #F08420; color: var(--on-brand); }
.btn--ghost { border-color: var(--line); 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 commission chain. Loud on purpose: this is the one that only reveals
   itself as a problem months later, when it is no longer fixable. */
.intro-missing { background: var(--danger-tint); border: 1px solid #FECACA; border-radius: 6px; padding: 7px 9px; }

/* The way-in editor. Collapsed by default so the list stays scannable; these
   fields are hand-entered from LinkedIn and the point is that 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(--ink-2); text-decoration: none; }
.topbar .who a:hover { color: var(--brand-text); }
.topbar .who .me { font-weight: 600; color: var(--ink); }
.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, not buried. */
.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); }
