/* Dashboard-specific styles — extends readiness.css tokens */

/* Nav */
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
}
.nav-link.active { background: var(--navy); color: white; }

/* Sections */
.dashboard-section { margin-bottom: 32px; }
.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.section-header h2 { margin: 0; }

/* Filter chips (legacy + new filter-bar) */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  flex-wrap: wrap;
}
.filter-label { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.filter-label.sort-label { margin-left: 0.75rem; }
.chip {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.chip.active { background: #2563eb; color: white; }
.chip:hover:not(.active) { background: #e5e7eb; }
.new-count-badge {
  margin-left: auto;
  font-size: 0.8rem;
  color: #2563eb;
  font-weight: 600;
}

/* Crawl strip */
.crawl-strip {
  font-size: 0.75rem;
  color: #9ca3af;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

/* Empty state */
.empty-state { color: var(--muted); font-size: 13px; padding: 16px 0; }

/* Tender list */
.tender-list { display: flex; flex-direction: column; }

/* Tender card */
.tender-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}
.tender-card.snoozed { opacity: 0.45; font-style: italic; }
.tender-card.new-since-visit { border-left: 2px solid #2563eb; }
.tender-card.viewed { opacity: 0.6; }

/* Score chip */
.score-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.score-chip.score-green  { background: #d1fae5; color: #065f46; }
.score-chip.score-amber  { background: #fef3c7; color: #92400e; }
.score-chip.score-dim    { background: #f3f4f6; color: #9ca3af; }

/* MEP triplet */
.mep-triplet { display: inline-flex; gap: 2px; font-weight: 700; font-size: 0.72rem; }
.mep-letter  { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 3px; color: #fff; }
.mep-letter-m { background: #0369a1; }
.mep-letter-e { background: #b45309; }
.mep-letter-p { background: #15803d; }
.mep-miss    { background: #e5e7eb; color: #9ca3af; }

/* Tender main body */
.tender-main { flex: 1; min-width: 0; }
.tender-top-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tender-title {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: inherit;
}
.tender-title:hover { text-decoration: underline; }
.tender-sub-line {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-icons { font-size: 0.75rem; white-space: nowrap; flex-shrink: 0; }
.addendum-count.has-new { color: #dc2626; }

/* Tender action buttons */
.tender-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  align-items: center;
}
.tender-actions button {
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  cursor: pointer;
}
.tender-actions button:hover { background: #f9fafb; }

/* Two-column detail layout */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
  gap: 0;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.detail-left {
  overflow-y: auto;
  padding: 1.25rem;
  border-right: 1px solid #e5e7eb;
}
.detail-right {
  overflow-y: auto;
  padding: 1rem;
  background: #fafafa;
}
.detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.back-link { color: #6b7280; text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: #111; }
.detail-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem 0; }
.detail-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.action-btn {
  padding: 0.3rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
}
.action-btn.primary {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}
.action-btn:hover:not(.primary) { background: #f9fafb; }
.action-btn.primary:hover { background: #1d4ed8; }

/* Metadata table */
.detail-meta { margin-bottom: 1.25rem; }
.meta-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
}
.meta-label { color: #9ca3af; min-width: 6rem; flex-shrink: 0; }

/* Detail sections */
.detail-section { margin-bottom: 1.25rem; }
.section-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}

/* Score breakdown */
.score-breakdown { font-size: 0.875rem; }
.score-total { font-size: 1rem; margin-bottom: 0.5rem; }
.score-line {
  display: flex;
  gap: 0.75rem;
  padding: 0.15rem 0;
}
.score-pts { min-width: 2.5rem; text-align: right; font-weight: 600; color: #059669; }
.score-line.negative .score-pts { color: #dc2626; }
.score-label { color: #374151; }

/* Addenda */
.addendum-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.2rem 0;
  font-size: 0.875rem;
}
.addendum-row.unread { font-weight: 600; }
.addendum-label { color: #2563eb; font-weight: 700; }
.addendum-date { color: #9ca3af; }
.new-badge {
  background: #dc2626;
  color: white;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
}
.doc-link { font-size: 0.8rem; color: #2563eb; text-decoration: none; }
.doc-link:hover { text-decoration: underline; }

/* Notes */
.notes-area {
  width: 100%;
  min-height: 80px;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}

/* PDF viewer */
.pdf-doc-selector { margin-bottom: 0.75rem; }
.pdf-doc-selector select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.85rem;
}
.pdf-container {
  background: #e5e7eb;
  border-radius: 4px;
  overflow: auto;
  max-height: calc(100vh - 180px);
}
.pdf-container canvas { display: block; margin: 0 auto; }
.pdf-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.pdf-nav button {
  padding: 0.2rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  cursor: pointer;
}
.pdf-empty { padding: 2rem; text-align: center; color: #9ca3af; }

/* Score verdict panel */
.verdict-rows { display: flex; flex-direction: column; gap: 6px; padding: 10px 0 4px; }
.verdict-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.verdict-label {
  min-width: 90px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* Pursuing rows */
.pursued-list { display: flex; flex-direction: column; gap: 6px; }
.pursued-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
}
.pursued-row a { font-weight: 600; color: var(--navy); text-decoration: none; flex: 1; }
.pursued-row a:hover { text-decoration: underline; }
.portal-source-link { font-size: 12px; color: var(--muted); text-decoration: none; margin-left: 4px; }
.portal-source-link:hover { color: var(--navy); }
.days-to-close { font-size: 12px; color: var(--muted); }
.days-to-close.urgent { color: var(--bad); font-weight: 700; }
.days-to-close.soon  { color: #d97706; font-weight: 600; }
.gc-name.gc-flag-prefer { color: #065f46; font-weight: 600; }
.gc-name.gc-flag-avoid  { color: #dc2626; }

/* Action button subtle variant (for Skip) */
.action-btn.subtle {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.action-btn.subtle:hover { color: var(--ink); background: #f3f4f6; border-color: #d1d5db; }

/* Mobile: stack detail layout columns */
@media (max-width: 760px) {
  .detail-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .detail-left {
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  .detail-right {
    overflow-y: visible;
  }
  .pdf-container {
    max-height: 60vh;
  }
  .tender-actions {
    flex-wrap: wrap;
  }
}

/* Bid Cracker CTA */
.bid-cracker-cta {
  display: inline-block;
  margin: 8px 0 16px;
  padding: 6px 14px;
  background: #15244C;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.bid-cracker-cta:hover { background: #1e3a6e; }

/* ── Portal pills ── */
.portal-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.portal-merx      { background: #dbeafe; color: #1e40af; }
.portal-biddingo  { background: #d1fae5; color: #065f46; }
.portal-bidsandtenders { background: #fef3c7; color: #92400e; }
.portal-b\&t      { background: #fef3c7; color: #92400e; }

/* ── Bid Crack layout ── */
.bc-page { display: flex; flex-direction: column; height: calc(100vh - 56px); }

.bc-header {
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}
.bc-title { font-size: 18px; font-weight: 700; color: #15244C; margin: 4px 0; }
.bc-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.bc-meta-item { font-size: 13px; color: #64707D; }

.bc-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left doc tree */
.bc-left {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  background: #fafafa;
  display: flex;
  flex-direction: column;
}
.bc-tree-header {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.bc-tree { flex: 1; overflow-y: auto; padding: 8px 0; }

.bc-tree-group { margin-bottom: 2px; }
.bc-tree-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
}
.bc-tree-group-header:hover { background: #f0f2f5; }
.bc-tree-toggle { font-size: 10px; color: #9ca3af; }
.bc-group-name { flex: 1; }
.bc-group-count {
  font-size: 11px;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 10px;
}

.bc-tree-items { padding-left: 12px; }
.bc-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: #4b5563;
  cursor: pointer;
  border-radius: 4px;
}
.bc-tree-item:hover { background: #f0f2f5; }
.bc-item-highlight { background: #fffbeb; }
.bc-item-highlight:hover { background: #fef3c7; }
.dot-new { color: #f59e0b; font-size: 8px; }

/* Discipline badges */
.disc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.disc-mech { background: #fed7aa; color: #c2410c; }
.disc-plumb { background: #bfdbfe; color: #1d4ed8; }
.disc-elec  { background: #fef08a; color: #a16207; }
.disc-fp    { background: #fecaca; color: #b91c1c; }
.disc-spec  { background: #e9d5ff; color: #6d28d9; }
.disc-add   { background: #d1fae5; color: #065f46; }

/* Sheet badges */
.sheet-badge {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.sheet-mech  { background: #fed7aa; color: #c2410c; }
.sheet-plumb { background: #bfdbfe; color: #1d4ed8; }
.sheet-elec  { background: #fef08a; color: #a16207; }
.sheet-fp    { background: #fecaca; color: #b91c1c; }

/* Right panel */
.bc-right {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bc-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin-bottom: 10px;
}

/* Scope chips */
.bc-scope-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.scope-chip {
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
}
.scope-high { background: #d1fae5; color: #065f46; }
.scope-med  { background: #fef3c7; color: #92400e; }
.scope-zero { background: #f3f4f6; color: #9ca3af; }

/* Cards */
.bc-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 18px;
}

.bc-summary-list {
  margin: 0;
  padding-left: 18px;
  color: #374151;
  font-size: 13px;
  line-height: 1.7;
}

/* Ask docs */
.bc-ask-row { display: flex; gap: 8px; margin-bottom: 12px; }
.bc-ask-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #374151;
  background: #f9fafb;
}
.bc-ask-btn {
  padding: 8px 14px;
  background: #15244C;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.bc-answer-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 14px;
}
.bc-answer-text { font-size: 13px; color: #374151; margin-bottom: 6px; }
.bc-answer-source { }
.citation-chip {
  display: inline-block;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}
.preview-tag {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .04em;
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
}

/* Plan-takers */
.bc-plantakers { font-size: 13px; color: #374151; line-height: 1.6; }
.bc-plantaker-count { font-size: 22px; font-weight: 700; color: #15244C; }
.bc-mep-highlight { display: block; margin-top: 4px; color: #065f46; font-weight: 600; }

/* ── Score breakdown — 3D model ── */
.score-breakdown { font-size: 13px; }
.score-total { font-size: 15px; margin-bottom: 10px; color: #15244C; }
.score-dim {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.score-dim-label { width: 120px; color: #64707D; flex-shrink: 0; }
.score-bar-wrap {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.score-bar {
  height: 100%;
  background: #15244C;
  border-radius: 3px;
  transition: width .3s ease;
}
.score-dim-val { width: 80px; color: #374151; font-size: 12px; white-space: nowrap; }
.score-disciplines { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.disc-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}
.disc-tag-mechanical    { background: #fed7aa; color: #c2410c; }
.disc-tag-plumbing      { background: #bfdbfe; color: #1d4ed8; }
.disc-tag-electrical    { background: #fef08a; color: #a16207; }
.disc-tag-fire-protection { background: #fecaca; color: #b91c1c; }
.score-note { font-size: 11px; color: #9ca3af; margin-top: 6px; }
.score-note.score-fail  { color: #b91c1c; }
.gc-flag-chip {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 700;
  vertical-align: middle;
}
.gc-flag-prefer  { background: #d1fae5; color: #065f46; }
.gc-flag-repeat  { background: #dbeafe; color: #1e40af; }

/* Active dropdown parent */
.active-dropdown > .nav-dropdown-toggle { background: var(--navy); color: white; }

/* Badge dot in nav */
.nav-badge { color: #ef4444; font-size: 10px; vertical-align: super; }

/* Pill color variants for new statuses */
.pill.blue { background: #dbeafe; color: #1d4ed8; }
.pill.amber { background: #fef3c7; color: #d97706; }
.pill.green { background: #dcfce7; color: #16a34a; }
.gc-flag-neutral { background: #f3f4f6; color: #6b7280; }

.bc-not-ready { padding: 24px; text-align: center; color: var(--muted); }
.bc-not-ready .action-btn { margin-top: 8px; }
.crack-status.error { padding: 8px 12px; background: #fee2e2; color: #991b1b; border-radius: 4px; }
