/* Brainviser lead desk - styled to match TimetablePro (brainviser.in/timetable/): Materialize blue top bar, pale-blue
   page, blue headings, teal action buttons, Roboto, white cards with soft shadows. Components come from Tabler
   (vendor/tabler.min.css, MIT); this file sets the tokens, fonts and the few hooks app.js emits. */

@font-face { font-family: "Roboto"; font-weight: 300; font-display: swap; src: url("/vendor/fonts/roboto-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url("/vendor/fonts/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url("/vendor/fonts/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-display: swap; src: url("/vendor/fonts/roboto-latin-700-normal.woff2") format("woff2"); }

:root, :root[data-bs-theme] {
  --blue: #2196f3;      /* top bar */
  --blue-d: #1976d2;    /* headings, links */
  --blue-l: #64b5f6;
  --indigo: #3949ab;    /* pill gradient start (their LIVE DEMO button) */
  --page: #f5faff;
  --grey: #f5f5f5;
  --text: #444;
  --text-2: #666;
  --teal: #26a69a;      /* action buttons */
  --teal-d: #00897b;
  --orange: #ff9800;    /* highlight (their "Most popular" plan) */
  --rule: #e1e8ef;
  --ok: #2e7d32;
  --fail: #d32f2f;
  --stalled: #90a4ae;
  --shadow: 0 2px 8px rgba(33, 80, 130, 0.10);
  --btn-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);

  --tblr-font-sans-serif: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tblr-body-font-family: var(--tblr-font-sans-serif);
  --tblr-body-bg: var(--page);
  --tblr-body-color: var(--text);
  --tblr-secondary: var(--text-2);
  --tblr-border-color: var(--rule);
  --tblr-primary: var(--teal);
  --tblr-primary-rgb: 38, 166, 154;
  --tblr-primary-fg: #fff;
  --tblr-primary-darken: var(--teal-d);
  --tblr-link-color: var(--blue-d);
  --tblr-link-hover-color: #0d47a1;
}

:focus-visible { outline: 2px solid var(--blue-d); outline-offset: 2px; }
body { font-size: 0.9375rem; font-weight: 400; }

/* Buttons: teal, uppercase, small radius, Materialize shadow */
.btn-primary, .btn-login { color: #fff; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; background: var(--teal); border-color: var(--teal); border-radius: 2px; box-shadow: var(--btn-shadow); }
.btn-primary:hover:not(:disabled), .btn-login:hover:not(:disabled) { color: #fff; background: #2bbbad; border-color: #2bbbad; }
.btn-outline-secondary { color: var(--teal-d); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; background: #fff; border-color: var(--teal); border-radius: 2px; }
.btn-outline-secondary:hover:not(:disabled) { color: #fff; background: var(--teal); border-color: var(--teal); }
.btn-link { color: var(--blue-d); font-weight: 500; }

/* Header: the same blue bar as TimetablePro */
.desk-nav { background: rgba(33, 150, 243, 0.95); border-bottom: 0; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18); }
.desk-nav > .container-xl { max-width: 1680px; padding-inline: 1.25rem; }
.desk-nav .navbar-brand { color: #fff; font-size: 1.25rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.desk-nav .navbar-brand span { margin-left: 0.8rem; font-size: 0.9375rem; font-weight: 300; letter-spacing: 0; text-transform: none; color: #e3f2fd; }
.run-picker { display: flex; gap: 0.5rem; margin-left: auto; }
.run-picker select { width: auto; max-width: 15rem; }
.desk-nav .form-select { background-color: var(--blue-d); border-color: var(--blue-l); color: #fff; }
.desk-nav .form-select option { background: #fff; color: var(--text); }
.desk-nav .btn-outline-light { color: #fff; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; border-color: #fff; border-radius: 28px; }
.desk-nav .btn-outline-light:hover { color: var(--blue-d); background: #fff; }
details > summary { cursor: pointer; }

/* Page: pale blue ground, white sheets with soft shadows */
.desk { max-width: 1680px; margin: 0 auto; padding: 1rem 1.25rem 2.5rem; }
#status { flex-basis: 100%; color: var(--text-2); font-size: 0.8125rem; }
#status.error { color: var(--fail); font-weight: 500; }
.strip { display: flex; flex-wrap: wrap; gap: 0.15rem 1.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); color: var(--text-2); font-size: 0.875rem; }
.strip strong { margin-right: 0.25rem; color: var(--blue-d); font-size: 1.125rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.source-panel { border-bottom: 1px solid var(--rule); }
.source-panel > summary { padding: 0.55rem 0; font-size: 0.875rem; font-weight: 500; color: var(--blue-d); }
.source-body { padding: 0 0 1rem; max-width: 70ch; }
.badge { text-transform: none; letter-spacing: 0; font-size: 0.75rem; font-weight: 500; }
.workspace { display: grid; grid-template-columns: 23rem minmax(0, 1fr); gap: 1.75rem; align-items: start; margin-top: 1rem; }
footer { margin-top: 2rem; }

/* Company list */
.list-pane { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; padding-right: 0.25rem; }
.filters { display: grid; gap: 0.5rem; margin-bottom: 0.25rem; }
.filters .form-control, .filters .form-select { background-color: #fff; }
.more-filters > summary { font-size: 0.875rem; font-weight: 500; color: var(--blue-d); }
.more-grid { display: grid; gap: 0.3rem; padding: 0.6rem 0 0.25rem; }
.more-grid .form-label { margin: 0.4rem 0 0; font-size: 0.8125rem; color: var(--text-2); }
.form-hint { margin: 0.5rem 0 0; }
#list-caption { margin: 0.75rem 0 0.4rem; }

/* View tabs: the indigo-to-blue pill from their LIVE DEMO button */
.view-tabs { display: flex; gap: 0.25rem; padding: 0.25rem; background: #e3f2fd; border-radius: 28px; }
.view-tab { flex: 1; padding: 0.4rem 0.5rem; font: inherit; font-size: 0.875rem; font-weight: 500; color: var(--blue-d); background: transparent; border: 0; border-radius: 28px; cursor: pointer; }
.view-tab.is-active { color: #fff; background: linear-gradient(90deg, var(--indigo) 0%, #1e88e5 100%); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18); }

/* One row per company: avatar, name and score, the reason in one line, then the signal */
.leads { display: flex; flex-direction: column; background: #fff; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.leads > p { margin: 0; padding: 1rem; color: var(--text-2); }
.leads .co-row { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; column-gap: 0.75rem; row-gap: 0.1rem; width: 100%; padding: 0.7rem 0.75rem 0.7rem 0.6rem;
  font: inherit; color: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; cursor: pointer; }
.leads .co-row:last-child { border-bottom: 0; }
.leads .co-row::before, .co-avatar { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; font-size: 1rem; font-weight: 500; color: var(--tone-fg, #fff); background: var(--tone-bg, var(--blue-d)); }
.leads .co-row::before { content: attr(data-initial); grid-column: 1; grid-row: 1 / 4; align-self: start; }
[data-tone="0"] { --tone-bg: #e3f2fd; --tone-fg: #1565c0; }
[data-tone="1"] { --tone-bg: #e0f2f1; --tone-fg: #00695c; }
[data-tone="2"] { --tone-bg: #fff3e0; --tone-fg: #e65100; }
[data-tone="3"] { --tone-bg: #e8eaf6; --tone-fg: #283593; }
[data-tone="4"] { --tone-bg: #fce4ec; --tone-fg: #ad1457; }
[data-tone="5"] { --tone-bg: #e0f7fa; --tone-fg: #00838f; }
.leads .co-row:hover { background: #f1f8ff; }
.leads .co-row.selected { background: #e3f2fd; box-shadow: inset 3px 0 0 var(--blue-d); }
.leads .co-row strong, .leads .co-row small { min-width: 0; }
.leads .co-row strong { grid-column: 2; grid-row: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; font-weight: 500; color: #263238; }
.leads .co-row .score { grid-column: 3; grid-row: 1; text-align: right; font-size: 1.0625rem; font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--blue-d); }
.leads .co-row .score.hi { color: var(--ok); }
.leads .co-row .score.lo { color: var(--stalled); }
.leads .co-row small { color: var(--text-2); font-size: 0.8125rem; line-height: 1.4; }
.leads .co-row small:nth-of-type(1) { grid-column: 2 / 4; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leads .co-row small:nth-of-type(2) { grid-column: 2; grid-row: 3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-signal { grid-column: 3; grid-row: 3; justify-self: end; align-self: center; padding: 0.05rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.co-signal.now { color: #00695c; background: #e0f2f1; }
.co-signal.maybe { color: #e65100; background: #fff3e0; }
.co-signal.hold { color: #546e7a; background: #eceff1; }

/* The company being read: one white card */
.detail { padding: 1.75rem 2rem 2rem; background: #fff; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.detail:has(> form) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.detail h2 { margin: 0; font-size: 1.75rem; font-weight: 400; line-height: 1.15; color: var(--blue-d); }
.detail h3 { margin: 1.5rem 0 0.4rem; font-size: 0.9375rem; font-weight: 500; color: #263238; }
.detail p { max-width: 68ch; }
.detail .eyebrow { margin: 0 0 0.25rem; font-size: 0.8125rem; color: var(--text-2); }
.record-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.75rem; }
.record-head .co-avatar { flex: none; width: 2.75rem; height: 2.75rem; font-size: 1.25rem; }
.queue-nav { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; font-size: 0.8125rem; white-space: nowrap; }
.queue-nav .muted { min-width: 3.5rem; text-align: center; }
.step { width: 2rem; height: 2rem; font: inherit; font-size: 1.25rem; line-height: 1; color: var(--blue-d); background: #fff; border: 1px solid var(--rule); border-radius: 50%; cursor: pointer; }
.step:hover:not(:disabled) { background: #e3f2fd; }
.step:disabled { color: var(--stalled); cursor: default; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; margin: 0 0 1.25rem; font-size: 0.875rem; color: var(--text-2); }
.chips .chip:first-child { padding: 0.15rem 0.7rem; border-radius: 999px; background: linear-gradient(90deg, var(--indigo) 0%, #1e88e5 100%); color: #fff; font-weight: 500; }
.lede { max-width: 34em !important; margin: 0 0 1.25rem; font-size: 1.375rem; font-weight: 300; line-height: 1.45; color: #263238; }
.props { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.35rem 1rem; margin: 1.25rem 0 0; font-size: 0.9375rem; }
.props dt { font-weight: 400; color: var(--text-2); }
.props dd { margin: 0; }
.project-card { margin: 1.25rem 0; padding: 0.6rem 1rem; background: #e0f7fa; border-left: 4px solid var(--teal); border-radius: 0 8px 8px 0; }
.project-card h3 { margin: 0.1rem 0 0.25rem; font-size: 1.0625rem; color: #006064; }
.project-card p { margin: 0.25rem 0; }
.detail blockquote { margin: 0.75rem 0; padding: 0.1rem 0 0.1rem 1rem; border-left: 3px solid var(--blue-l); font-size: 1rem; font-weight: 300; line-height: 1.6; color: #37474f; }
.detail pre { padding: 0; font-family: inherit; font-size: 0.9375rem; line-height: 1.6; white-space: pre-wrap; background: none; border: 0; }
.detail details { padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.detail details > summary { font-weight: 500; color: var(--blue-d); }
.checks { margin-top: 1.5rem; }
.checks > details { margin-left: 0.25rem; }
.fit { margin: 0.5rem 0; }
.score-line { display: flex; justify-content: space-between; max-width: 24rem; padding: 0.15rem 0; border-bottom: 1px dotted var(--rule); font-variant-numeric: tabular-nums; }
.notice { color: #5d4037; background: #fff8e1; border: 1px solid #ffe0b2; border-left: 4px solid var(--orange); }
.notice.error { color: var(--fail); }

/* Draft: always in reach */
.draft-form { padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.draft-form h3 { margin-top: 0; font-size: 1.0625rem; color: var(--blue-d); }
.draft-form label { margin-top: 0.75rem; color: var(--text-2); }
.draft-form > h3 + p, .draft-form > .secondary + p { display: none; }
.draft-form > button.secondary { padding: 0.25rem 0.7rem; font-size: 0.8125rem; }
.draft-form #recipient, .draft-form #subject { padding-left: 0; padding-right: 0; background: transparent; border-color: transparent; border-bottom-color: #9e9e9e; border-radius: 0; box-shadow: none; }
.draft-form #recipient:focus, .draft-form #subject:focus { border-bottom: 2px solid var(--teal); }
.draft-form #subject { font-size: 1.0625rem; font-weight: 500; color: #263238; }
.draft-form textarea { padding-left: 0; padding-right: 0; border-color: transparent; border-radius: 0; box-shadow: none; }
.draft-form textarea { min-height: 11rem; font-size: 1rem; line-height: 1.6; }
.draft-form > button { margin-top: 0.75rem; margin-right: 0.5rem; }
.actions { position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; padding: 0.75rem 0; background: #fff; border-top: 1px solid var(--rule); }
.contact-research, .email-preview { margin: 1rem 0; padding: 1rem; border: 1px solid var(--rule); border-radius: 8px; background: #f5faff; }
.contact-research:empty, .email-preview:empty { display: none; }

@media (min-width: 1280px) {
  .detail:has(> form) { grid-template-columns: minmax(0, 1fr) 24rem; gap: 2.25rem; }
  .draft-form { position: sticky; top: 1rem; align-self: start; padding: 0 0 0 2.5rem; border-top: 0; border-left: 1px solid var(--rule); max-height: calc(100vh - 13rem); overflow-y: auto; }
}

/* Phones and narrow windows: list first, tapping a company opens the detail full-screen */
@media (max-width: 991.98px) {
  .workspace { display: block; }
  .list-pane { position: static; max-height: none; overflow: visible; }
  .workspace .detail-pane { display: none; }
  .workspace.show-detail .list-pane { display: none; }
  .workspace.show-detail .detail-pane { display: block; }
  body:has(.workspace.show-detail) :is(.strip, .source-panel, #status) { display: none; }
  .detail { padding: 1.25rem; }
  .record-head { flex-wrap: wrap; }
  .queue-nav { order: -1; flex-basis: 100%; justify-content: flex-end; margin: 0 0 0.1rem; }
  .props { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.35rem 0.75rem; }
  .desk-nav .navbar-brand span { display: none; }
}

/* Login page: the same card as TimetablePro's School Login */
.login-page { display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 1.5rem; background: var(--grey); }
.login-card { width: 100%; max-width: 25rem; padding: 2.25rem 2rem 1.75rem; background: #fff; border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); text-align: center; }
.login-brand { margin: 0 0 0.25rem; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-d); }
.login-card h1 { margin: 0 0 1.75rem; font-size: 1.875rem; font-weight: 400; color: #212121; }
.login-field { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; text-align: left; }
.login-field > svg { flex: none; width: 1.75rem; height: 1.75rem; margin-bottom: 0.35rem; fill: #212121; }
.login-field > div { flex: 1; }
.login-field label { display: block; margin: 0; font-size: 0.8125rem; color: #9e9e9e; }
.login-field input { width: 100%; padding: 0.4rem 0; font: inherit; font-size: 1rem; color: #212121; background: transparent; border: 0; border-bottom: 1px solid #9e9e9e; border-radius: 0; outline: 0; box-shadow: none; }
.login-field input:focus { border-bottom: 2px solid var(--teal); margin-bottom: -1px; }
.login-error { margin: -0.5rem 0 1rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; text-align: left; color: #b71c1c; background: #ffebee; border-left: 4px solid var(--fail); border-radius: 0 4px 4px 0; }
.btn-login { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1.5rem; font: inherit; font-size: 0.875rem; cursor: pointer; border: 0; }
.btn-login svg { width: 1.125rem; height: 1.125rem; fill: #fff; }
.btn-login:disabled { opacity: 0.6; cursor: default; }
.login-help { margin: 1.5rem 0 0; font-size: 0.875rem; color: var(--text-2); }
