/* FirstFiling dashboard. Builds on site.css tokens. */

.dash-body { background: #fff; }

/* ---------------------------------------------------------------- Header */
.dash-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 30; }
.dash-header-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 20px;
  min-height: 58px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.dash-account { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.status-pill {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.status-pill.ok { background: var(--good-bg); border-color: #b9dcc4; color: var(--good); }
.status-pill.warn { background: var(--warn-bg); border-color: #f1d98a; color: var(--warn); }
.status-pill.bad { background: var(--bad-bg); border-color: #f3b8b4; color: var(--bad); }
.dash-header-notes { flex: 1; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); min-width: 0; }
.dash-header-notes .note-item { white-space: nowrap; }
.dash-header-notes .note-item strong { color: var(--ink); font-weight: 600; }
.dash-header-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

.dash-notice { max-width: 1100px; margin: 14px auto 0; width: calc(100% - 40px); }

/* ---------------------------------------------------------------- Sign in */
.signin-panel { padding: 48px 20px; }
.signin-card { max-width: 480px; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.signin-card h1 { font-size: 22px; }
.signin-card p { color: var(--muted); font-size: 14.5px; }
.signin-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signin-row input { flex: 1 1 200px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 15px; }
.signin-row input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.signin-card .notice { margin-top: 14px; }
.signin-foot { margin: 16px 0 0; font-size: 13.5px; }

/* ---------------------------------------------------------------- Layout */
.dash-layout { max-width: 1140px; margin: 0 auto; padding: 20px 20px 80px; display: grid; grid-template-columns: 190px 1fr; gap: 28px; align-items: start; }
.dash-nav { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: 0; border-radius: 6px;
  padding: 9px 12px; text-align: left; font-size: 14px; font-weight: 500; color: var(--muted);
}
.nav-item:hover { background: var(--panel); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item .count { font-size: 11.5px; font-weight: 700; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item .count.warn { background: var(--warn-bg); border-color: #f1d98a; color: var(--warn); }
.dash-main { min-width: 0; }

.view-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.view-head h1 { font-size: 24px; margin-bottom: 2px; }
.view-sub { color: var(--muted); font-size: 14px; margin: 0; }
.view-tools { display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filters input, .filters select { padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 13.5px; min-width: 110px; }
.filters input[type="search"] { min-width: 200px; }
.filters input[type="number"] { width: 90px; min-width: 0; }

.bulk-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #fff; }
.bulk-select { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.bulk-select input { accent-color: var(--accent); width: 16px; height: 16px; }
.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Lead rows */
.leads-list { display: flex; flex-direction: column; gap: 10px; }
.leads-list[aria-busy="true"] { opacity: 0.6; }
.lead-row {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff;
}
.lead-row:hover { border-color: var(--line-strong); box-shadow: 0 1px 3px rgba(20, 23, 26, 0.06); }
.lead-row.is-dismissed { background: #fafbfc; }
.lead-row .sel { padding-top: 3px; }
.lead-row .sel input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.lead-row .main { min-width: 0; }
.lead-row .title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lead-row .name { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; font-size: 15.5px; color: var(--ink); text-align: left; cursor: pointer; }
.lead-row .name:hover { color: var(--accent); text-decoration: underline; }
.lead-row .industry { font-size: 14px; margin-top: 3px; }
.lead-row .industry .sector { color: var(--muted); }
.lead-row .meta { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.lead-row .meta .chip { font-size: 11.5px; padding: 1px 7px; }
.lead-row .contact { font-size: 13px; margin-top: 5px; }
.lead-row .contact strong { font-weight: 600; }
.lead-row .addr { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.lead-row .pipe { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.lead-row .pipe .due { color: var(--warn); font-weight: 600; }
.lead-row .pipe .due.overdue { color: var(--bad); }
.lead-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lead-row .quick { display: flex; gap: 4px; }
.lead-row .quick button {
  background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; font-size: 12px; color: var(--muted);
}
.lead-row .quick button:hover { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.lead-row .quick button.on { background: var(--accent-soft); color: var(--accent-ink); border-color: #c7d9f2; }
.stage-chip { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--grey-bg); color: var(--muted); }
.stage-chip.contacted { background: var(--accent-soft); color: var(--accent-ink); }
.stage-chip.meeting { background: #ede7fb; color: #4b2e9e; }
.stage-chip.won { background: var(--good-bg); color: var(--good); }
.stage-chip.lost { background: var(--bad-bg); color: var(--bad); }
.stage-chip.dismissed { background: var(--grey-bg); color: var(--muted); }

.pipeline-group { margin-bottom: 22px; }
.pipeline-group h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pipeline-group h2 .count { font-weight: 500; color: var(--muted); font-size: 13px; }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 36px 20px; text-align: center; color: var(--muted); font-size: 14.5px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); }
.hint.ok { color: var(--good); }
.hint.err { color: var(--bad); }

/* ---------------------------------------------------------------- Digests */
.digest-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; background: #fff; }
.digest-row .subj { font-weight: 600; font-size: 14.5px; }
.digest-row .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------------------------------------------------------------- Settings */
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.settings-nav a { font-size: 13px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; background: #fff; }
.settings-nav a:hover { color: var(--ink); border-color: var(--line-strong); }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; margin-bottom: 20px; background: #fff; }
.panel h2 { font-size: 18px; margin-bottom: 6px; scroll-margin-top: 80px; }
.panel > .hint { margin-bottom: 14px; display: block; }
.panel textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 14px; resize: vertical; }
.panel input[type="text"] { padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 14px; }
.panel .form-section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.panel .form-section:first-of-type { padding-top: 0; margin-top: 4px; border-top: 0; }
.suppress-list { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.suppress-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px; }
.suppress-item .nm { font-weight: 600; }
.suppress-item .nt { color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 14px; margin: 0 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.billing-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 8px; }
.billing-summary .stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); }
.billing-summary .stat .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.billing-summary .stat .v { font-size: 17px; font-weight: 700; margin-top: 2px; }
.billing-summary .stat .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------- Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 23, 26, 0.35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%);
  background: #fff; z-index: 50; box-shadow: -8px 0 32px rgba(20, 23, 26, 0.15);
  display: flex; flex-direction: column; outline: none;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px 22px 40px; overflow: auto; flex: 1; }
.drawer h2 { font-size: 21px; margin-bottom: 4px; }
.drawer .d-industry { font-size: 15px; margin-bottom: 2px; }
.drawer .d-meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-bottom: 10px; }
.drawer .d-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.drawer .d-summary { font-size: 14.5px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.drawer .d-summary .conf { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.drawer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 20px 0 8px; }
.drawer ul.plain { padding-left: 18px; font-size: 14px; margin: 0; }
.drawer ul.plain li { margin-bottom: 4px; }
.drawer .signals { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer .d-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 14px 0; }
.drawer .d-actions select, .drawer .d-actions input[type="date"] { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 13.5px; background: #fff; }
.drawer .d-actions label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.drawer .d-actions .spacer { flex: 1; }
.drawer .label-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer .label-row button.on { background: var(--accent-soft); border-color: #c7d9f2; color: var(--accent-ink); }
.drawer .label-note { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 13.5px; margin-top: 8px; }
.drawer textarea.notes { width: 100%; min-height: 84px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 14px; resize: vertical; }
.drawer .notes-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
table.record { width: 100%; border-collapse: collapse; font-size: 13px; }
table.record th, table.record td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.record th { color: var(--muted); font-weight: 500; width: 38%; word-break: break-word; }
table.record td { word-break: break-word; }
.related-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.related-item .rel { color: var(--muted); font-size: 12.5px; }
.outreach { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.outreach-block { margin-bottom: 14px; }
.outreach-block .ob-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.outreach-block .ob-head strong { font-size: 13px; }
.outreach-block pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13.5px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.outreach-block ul { font-size: 13.5px; margin: 0; padding-left: 18px; }
.outreach .cautions { color: var(--warn); }
.copy-btn { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; font-size: 12px; color: var(--muted); }
.copy-btn:hover { background: var(--panel); color: var(--ink); }
.copy-btn.done { color: var(--good); border-color: #b9dcc4; }
.upgrade-note { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; color: var(--muted); background: var(--panel); }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 860px) {
  .dash-layout { grid-template-columns: 1fr; gap: 16px; padding-top: 14px; }
  .dash-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
  .nav-item { white-space: nowrap; padding: 8px 10px; font-size: 13.5px; }
  .dash-header-notes { order: 3; width: 100%; padding-bottom: 8px; }
}
@media (max-width: 640px) {
  .dash-header-inner { gap: 10px; padding: 8px 16px; }
  .account-name { max-width: 160px; }
  .dash-header-actions .btn { padding: 5px 9px; font-size: 12.5px; }
  .dash-layout { padding: 12px 16px 60px; }
  .dash-notice { width: calc(100% - 32px); }
  .view-head h1 { font-size: 20px; }
  .filters { padding: 10px; gap: 8px 10px; }
  .filters label { flex: 1 1 130px; }
  .filters input[type="search"] { min-width: 0; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  .lead-row { grid-template-columns: 22px 1fr; padding: 12px; }
  .lead-row .side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; font-size: 12.5px; }
  .panel { padding: 16px 14px; }
  .drawer-body { padding: 14px 16px 40px; }
  .drawer .d-actions { gap: 6px; }
}
