.dashboard-status {
  border: 1px solid #86efac;
  border-radius: 10px;
  background: #ecfdf5;
  color: #166534;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
}

.dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.quick-actions {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-actions .btn {
  width: 100%;
}

.dashboard-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
}

.panel {
  padding: 16px;
}

.panel h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.flag-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flag-item {
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
}

.flag-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
}

.flag-dot.red { background: var(--red); }
.flag-dot.amber { background: var(--amber); }
.flag-dot.green { background: var(--green); }

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--grey-200);
  padding: 2px 9px;
  font-size: 12px;
}

.status-pill.ok {
  color: #166534;
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.status-pill.reject {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.pipeline {
  margin-top: 16px;
  padding: 16px;
}

.pipeline h3 {
  margin-bottom: 10px;
}

.pipeline-row {
  margin-bottom: 8px;
  font-size: 14px;
}

.pipe-pill {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 8px;
  margin-right: 4px;
}

.pipe-pill.active {
  background: #ede9ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.pipe-pill.done {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.audit-log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.audit-modal-card {
  background: #fff;
  border-color: #cbd5e1;
}

.audit-modal-title {
  margin-bottom: 10px;
}

.audit-log-entry {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.settings-modal-card {
  width: 680px;
  max-width: calc(100% - 40px);
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-color: #cbd5e1;
}

.settings-title {
  margin-bottom: 4px;
}

.settings-subtitle {
  margin-bottom: 12px;
  color: #64748b;
}

.settings-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  margin-top: 12px;
}

.settings-section h4 {
  margin-bottom: 10px;
  font-size: 15px;
  color: #334155;
}

.settings-grid {
  gap: 12px;
}

.settings-grid input[type='range'] {
  width: 100%;
  accent-color: var(--purple);
}

.settings-grid .toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-grid .toggle input {
  width: 42px;
  height: 22px;
}

.settings-grid .form-field input,
.settings-grid .form-field select,
.settings-grid .form-field textarea {
  background: #fff;
  color: #1e293b;
}

.settings-danger-wrap {
  justify-content: flex-end;
}

.settings-clear-btn {
  border: 1px solid #dc2626;
  background: transparent;
  color: #dc2626;
}

.settings-clear-btn:hover {
  background: #fef2f2;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.settings-reset-btn {
  border: 1px solid #94a3b8;
  background: transparent;
  color: #475569;
}

.settings-reset-btn:hover {
  background: #f8fafc;
}

.settings-close-btn {
  background: transparent;
  color: #64748b;
  padding-left: 8px;
  padding-right: 8px;
}

.settings-close-btn:hover {
  color: #334155;
  background: #f8fafc;
}

.audit-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #475569;
  margin-right: 8px;
}

.upload-zone {
  border: 2px dashed #93c5fd;
  border-radius: 14px;
  background: #f0f7ff;
  text-align: center;
  padding: 32px 24px;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.upload-zone:hover {
  border-color: #1E3A8A;
  background: #dbeafe;
}

.upload-zone p {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 500;
  color: #334155;
}

.uploaded-file-name {
  margin-top: 8px;
  font-size: 13px;
  color: #475569;
}

.demo-tender-row {
  margin-top: 10px;
}

.run-eval-btn {
  width: 100%;
  margin-top: 12px;
}

.step-block-top {
  margin-top: 16px;
}

.flags-container {
  display: grid;
  gap: 10px;
}

.override-success {
  margin-top: 10px;
  color: #166534;
  font-weight: 500;
}

.step-block {
  margin-bottom: 18px;
}

.step-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1E3A8A;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.eval-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
}

.tender-card {
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  margin-top: 12px;
}

.gov-doc-card {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.gov-doc-card pre {
  margin: 0;
  padding: 14px;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.vendor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vendor-card {
  border: 1px solid var(--grey-200);
  border-left: 4px solid #1E3A8A;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.vendor-card:hover {
  box-shadow: 0 4px 14px rgba(30,58,138,0.10);
  transform: translateY(-1px);
}

.vendor-neutral { border-left-color: #94a3b8; }

.vendor-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.vendor-card h4 {
  font-size: 15px;
}

.vendor-card p {
  font-size: 12px;
  color: #334155;
}

.doc-row {
  margin-top: 8px;
  font-size: 12px;
  color: #334155;
}

.doc-pill {
  display: inline-block;
  border: 1px solid #86efac;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  padding: 2px 8px;
  margin: 2px;
}

.evaluation-progress {
  margin-top: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.evaluation-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.evaluation-progress-fill {
  width: 0;
  height: 100%;
  background: var(--purple);
  -webkit-transition: width 120ms linear;
  transition: width 120ms linear;
}

.evaluation-progress-stage {
  margin-top: 8px;
  font-size: 13px;
  color: #334155;
}

.results-card {
  padding: 20px;
  border-top: 3px solid #1E3A8A;
}

.evaluation-time-banner {
  margin-bottom: 14px;
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.evaluation-time-banner::before { content: '⚡'; }

.reason-cell details {
  max-width: 220px;
}

.reason-cell summary {
  color: #4338ca;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.confidence-meter {
  width: 120px;
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
}

.confidence-fill.high { background: #16A34A; border-radius: 999px; }
.confidence-fill.mid  { background: #D97706; border-radius: 999px; }
.confidence-fill.low  { background: #DC2626; border-radius: 999px; }

.confidence-text {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
}

.read-aloud-btn {
  margin-top: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  padding: 4px 8px;
  font-size: 11px;
}

.flag-card {
  border: 1px solid var(--grey-200);
  border-left: 5px solid var(--amber);
  border-radius: 10px;
  background: #fffbeb;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideInLeft 260ms ease both;
}

.flag-card.danger {
  border-left-color: var(--red);
  background: #fef2f2;
}

.flag-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.flag-card h4 {
  font-size: 16px;
}

.flag-card p {
  color: #334155;
  font-size: 14px;
}

.flag-reco {
  border-top: 1px dashed #cbd5e1;
  padding-top: 10px;
  color: #1e293b;
  font-weight: 500;
}

.uncertainty-banner {
  margin-top: 14px;
  border: 1px solid #facc15;
  border-radius: 10px;
  background: #fffbeb;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.uncertainty-banner p {
  color: #78350f;
}

.override-panel {
  margin-top: 16px;
  border: 1px solid #fdba74;
  border-radius: 12px;
  overflow: hidden;
}

.override-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff7ed;
  color: #7c2d12;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.override-content {
  background: #fff;
  padding: 14px;
}

.override-warning {
  margin-bottom: 12px;
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  padding: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  color: #334155;
  font-size: 13px;
  font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gfr-panel {
  border: 1px solid #dbeafe;
  border-top: 3px solid #1E3A8A;
  border-radius: 10px;
  background: #f0f7ff;
  padding: 14px;
}

.gfr-panel h4 {
  margin-bottom: 10px;
  font-size: 15px;
  color: #1E3A8A;
  font-weight: 700;
}

.gfr-rule {
  margin-bottom: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
}

.gfr-rule strong {
  display: block;
  margin-bottom: 5px;
  color: #1E3A8A;
  font-size: 13px;
}

.gfr-rule p {
  color: #475569;
  font-size: 13px;
}

@media (max-width: 1150px) {
  .quick-actions,
  .dashboard-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-split,
  .eval-layout {
    grid-template-columns: 1fr;
  }

  .vendor-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENT INTELLIGENCE (DEMO)
   All rules are scoped to .doc-* — zero collision with existing styles.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ───────────────────────────────────────────────────── */
.doc-intel-section {
  border-left: 4px solid #6C47FF;
  background: #faf9ff;
  margin-bottom: 20px; /* extra breathing room above Step 1 */
}

.doc-intel-header {
  margin-bottom: 16px;
}

.doc-intel-badge {
  background: #ede9ff;
  color: #5b21b6;
  font-weight: 600;
  font-size: 12px;
}

.doc-intel-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #64748b;
}

/* ── Two-column upload grid ────────────────────────────────────────────── */
.doc-intel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Individual upload card ────────────────────────────────────────────── */
.doc-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-card-icon {
  font-size: 28px;
  line-height: 1;
}

.doc-card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: #1e293b;
}

.doc-card-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* ── Output area (populated by JS after extraction) ────────────────────── */
.doc-output {
  margin-top: 4px;
}

/* Fade-in wrapper injected by renderOutput() */
.doc-output-animate {
  -webkit-animation: docFadeIn 280ms ease both;
  animation: docFadeIn 280ms ease both;
}

@-webkit-keyframes docFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes docFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Demo notice banner ─────────────────────────────────────────────────
   Shown above every extraction result. Keeps judge expectations honest.
   Light blue-grey background — visible but not alarming.               */
.doc-demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  color: #3730a3;
  font-size: 12px;
  font-weight: 500;
  padding: 9px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Header row: label pill + confidence badge ──────────────────────────── */
.doc-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* "Extracted from PDF (Demo Mode)" pill */
.doc-label {
  font-size: 11px;
  font-weight: 600;
  background: #ede9ff;
  color: #5b21b6;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* "Extraction Confidence: XX%" badge */
.doc-confidence {
  font-size: 12px;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* ── Detected entity chips (GST, turnover, date, amount) ────────────────── */
.doc-entities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.doc-entity {
  font-size: 11px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 500;
}

/* ── Scrollable extracted-text box ─────────────────────────────────────── */
.doc-text-scroll {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  /* Custom scrollbar — subtle, not distracting */
  scrollbar-width: thin;
  scrollbar-color: #c4b5fd #f1f5f9;
}

.doc-text-scroll::-webkit-scrollbar { width: 6px; }
.doc-text-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.doc-text-scroll::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 3px; }

.doc-text-scroll pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── Highlight marks inside extracted text ──────────────────────────────
   Three distinct colours so judges can instantly distinguish value types. */

/* Yellow — evaluation keywords (turnover, GST, experience…) */
mark.doc-highlight {
  background: #fef9c3;
  color: #713f12;
  border-radius: 3px;
  padding: 1px 3px;
  font-style: normal;
}

/* Orange — currency values (₹ amounts, large numbers) */
mark.doc-highlight-currency {
  background: #ffedd5;
  color: #9a3412;
  border-radius: 3px;
  padding: 1px 3px;
  font-style: normal;
  font-weight: 600;
}

/* Blue — GST numbers */
mark.doc-highlight-gst {
  background: #dbeafe;
  color: #1e40af;
  border-radius: 3px;
  padding: 1px 3px;
  font-style: normal;
  font-weight: 600;
}

/* ── CTA block: "Use this data" button + helper text ────────────────────
   Sits directly below the extracted text. Prominent but not overwhelming. */
.doc-cta-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Primary CTA — inherits .btn .btn-primary, just adds sizing */
.doc-use-btn {
  font-size: 14px;
  padding: 10px 20px;
  font-weight: 600;
  white-space: nowrap;
  /* Stronger hover lift for demo visibility */
  -webkit-transition: transform 120ms ease, background-color 180ms ease, box-shadow 180ms ease;
  transition: transform 120ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.doc-use-btn:hover {
  background: #5b3bdd;
  box-shadow: 0 4px 12px rgba(108, 71, 255, 0.35);
  transform: translateY(-1px);
}

/* Helper text below the button */
.doc-cta-hint {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

/* ── Loading spinner ────────────────────────────────────────────────────
   Centred in the card while PDF/OCR is processing.                      */
.doc-spinner {
  display: flex;
  align-items: center;
  justify-content: center;   /* centred horizontally */
  gap: 10px;
  font-size: 13px;
  color: #475569;
  padding: 24px 0;           /* generous vertical space so it reads clearly */
  font-weight: 500;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #6C47FF;
  border-radius: 50%;
  -webkit-animation: spin 0.7s linear infinite;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@-webkit-keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin         { to { transform: rotate(360deg); } }

/* ── Error message ──────────────────────────────────────────────────────── */
.doc-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
  padding: 10px 12px;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Mapped fields panel (revealed after "Use this data") ───────────────
   Green-tinted to signal success and data flow.                         */
.doc-mapped-panel {
  margin-top: 16px;
  border: 1px solid #86efac;
  border-radius: 10px;
  background: #f0fdf4;
  padding: 16px;
  -webkit-animation: docFadeIn 300ms ease both;
  animation: docFadeIn 300ms ease both;
}

.doc-mapped-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
  color: #166534;
}

.doc-mapped-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 13px;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 5px;
  line-height: 1.6;
}

.doc-mapped-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.doc-mapped-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #166534;
}

.doc-mapped-input {
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  background: #fff;
  width: 165px;
  color: #1e293b;
}

.doc-mapped-input:focus {
  outline: 2px solid #6C47FF;
  outline-offset: 1px;
}

.doc-mapped-note {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  font-style: italic;
}

/* ── Responsive: stack to single column on narrow screens ───────────────── */
@media (max-width: 800px) {
  .doc-intel-grid {
    grid-template-columns: 1fr;
  }

  .doc-cta-block {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Tender Criteria Card (shown after PDF extraction) ───────────────────── */

.tender-criteria-card {
  margin-top: 14px;
  border: 1px solid #86efac;
  border-radius: 10px;
  background: #f0fdf4;
  padding: 14px 16px;
  animation: fadeInUp 280ms ease both;
}

.tcrit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

/* "✅ Criteria extracted from document" green badge */
.tcrit-badge {
  font-size: 13px;
  font-weight: 600;
  color: #166534;
}

/* filename shown next to the badge */
.tcrit-filename {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2×2 grid of extracted fields */
.tcrit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.tcrit-field {
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tcrit-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* value found in the PDF */
.tcrit-value {
  font-size: 14px;
  font-weight: 600;
}

.tcrit-found {
  color: #166534;
}

/* value not found — amber so it's visible but not alarming */
.tcrit-missing {
  color: #b45309;
}

.tcrit-note {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  font-style: italic;
}

@media (max-width: 600px) {
  .tcrit-grid {
    grid-template-columns: 1fr;
  }
}
