*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }

/* Header */
.bp-header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
}
.bp-header .logo {
  font-weight: 700;
  font-size: 20px;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.bp-header nav a {
  color: var(--white);
  margin-left: 20px;
  font-size: 14px;
}
.bp-header nav a:hover { color: var(--gold); }

/* Footer */
.bp-footer {
  padding: 24px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}

/* Layout */
.bp-container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 16px;
}
.card h2 { margin-top: 0; color: var(--navy); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
}
.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: #13233d; }
.btn-gold {
  background: var(--gold);
  color: var(--navy);
}
.btn-gold:hover { background: #b89632; }

/* Login-specific */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy), #13233d);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.login-card h1 {
  color: var(--gold);
  margin: 0 0 24px 0;
  text-align: center;
  font-size: 28px;
}
.login-card .error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

/* Toast */
.bp-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  display: none;
}
.bp-toast.show { display: block; }

/* =========================================================================
   Sidebar layout (dashboard.html, approvals.html)
   ========================================================================= */
.bp-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: var(--navy);
  color: var(--white);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  z-index: 10;
}
.bp-sidebar .bp-logo {
  font-weight: 700;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 0.5px;
  padding: 0 24px 24px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.bp-sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  flex: 1;
}
.bp-sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bp-sidebar nav a:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.04);
}
.bp-sidebar nav a.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}
.bp-sidebar .bp-sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.bp-sidebar .bp-sidebar-footer a {
  color: var(--gold);
  font-weight: 600;
}

.bp-main {
  margin-left: 240px;
  padding: 32px 40px 48px 40px;
  min-height: 100vh;
}
.bp-main h1 {
  margin: 0 0 24px 0;
  color: var(--navy);
  font-size: 26px;
  font-weight: 700;
}

/* Badges / pills */
.bp-badge {
  display: inline-block;
  min-width: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: var(--gold);
  color: var(--navy);
  border-radius: 999px;
  line-height: 16px;
}
.bp-badge-empty { display: none; }

/* =========================================================================
   Agent banner (gold — dashboard)
   ========================================================================= */
.bp-agent-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--gold), #e0bd5e);
  color: var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.bp-agent-banner.hidden { display: none; }
/* Severidade: amarelo = atenção, não crítico (orders_no_category, etc). */
.bp-agent-banner.bp-agent-banner-warning {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #78350F;
  border-left: 4px solid var(--warning);
}
.bp-agent-banner .bp-agent-message {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}
.bp-agent-banner .bp-agent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bp-agent-banner .btn {
  padding: 8px 14px;
  font-size: 13px;
}
.bp-agent-banner .btn-primary { background: var(--navy); color: var(--white); }
.bp-agent-banner .btn-ghost {
  background: transparent;
  border: 1px solid var(--navy);
  color: var(--navy);
}
.bp-agent-banner .btn-ghost:hover { background: rgba(10, 22, 40, 0.08); }

/* =========================================================================
   KPI grid (dashboard)
   ========================================================================= */
.bp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.bp-kpi-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  text-align: left;
  font-family: var(--font);
}
.bp-kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--gold);
  transform: translateY(-1px);
}
.bp-kpi-card .bp-kpi-label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.bp-kpi-card .bp-kpi-value {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  margin-top: 6px;
}
.bp-kpi-card.is-critical { border-left-color: var(--danger); }
.bp-kpi-card.is-critical .bp-kpi-value { color: var(--danger); }
.bp-kpi-card.is-warning  { border-left-color: var(--warning); }

/* Two-column row under the KPI grid */
.bp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .bp-row { grid-template-columns: 1fr; }
}

/* SLA alerts list */
.bp-sla-list { list-style: none; padding: 0; margin: 0; }
.bp-sla-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.bp-sla-list li:last-child { border-bottom: none; }
.bp-sla-alert-warning,
.bp-sla-alert-critical {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.bp-sla-alert-warning  { background: rgba(217, 119, 6, 0.15);  color: var(--warning); }
.bp-sla-alert-critical { background: rgba(220, 38, 38, 0.15);  color: var(--danger); }

/* Activity feed */
.bp-activity-list { list-style: none; padding: 0; margin: 0; }
.bp-activity-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--gray-700);
}
.bp-activity-list li:last-child { border-bottom: none; }
.bp-activity-kind {
  display: inline-block;
  min-width: 58px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--gray-100);
  color: var(--navy);
  border-radius: 4px;
  text-align: center;
}
.bp-activity-title { flex: 1; color: var(--navy); font-weight: 500; }
.bp-activity-time  { color: var(--gray-500); font-size: 12px; }

/* =========================================================================
   Approvals Central layout
   ========================================================================= */
.bp-approvals-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .bp-approvals-layout { grid-template-columns: 1fr; }
}

.bp-filters h3 {
  margin: 0 0 12px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
}
.bp-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
}
.bp-filters .bp-filters-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.bp-filters .btn { width: 100%; text-align: center; }

.bp-approvals-group { margin-bottom: 24px; }
.bp-approvals-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px 0;
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
}
.bp-approvals-group-title .bp-badge { background: var(--navy); color: var(--white); }
.bp-approvals-group.is-hidden { display: none; }

.bp-approval-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.bp-approval-item input[type="checkbox"] { margin-top: 4px; }
.bp-approval-body { min-width: 0; }
.bp-approval-subject {
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 4px 0;
  font-size: 14px;
}
.bp-approval-meta {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0 0 8px 0;
}
.bp-approval-preview {
  font-size: 13px;
  color: var(--gray-700);
  white-space: pre-wrap;
  max-height: 80px;
  overflow: hidden;
  position: relative;
}
.bp-approval-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}
.bp-approval-actions .btn {
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.bp-approval-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
}

/* =========================================================================
   Suppliers Library — tables, modals, tabs, filters, chips
   Added in Prompt 5. Also reused by later SC/orders/RFQ pages.
   ========================================================================= */

/* Page header row */
.bp-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.bp-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bp-page-subtitle {
  margin: -8px 0 16px;
  font-size: 13px;
  color: var(--gray-500);
}
.bp-page-subtitle a { color: var(--gold); text-decoration: none; }
.bp-page-subtitle a:hover { text-decoration: underline; }

/* Info banner */
.bp-info-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  color: var(--navy);
  font-size: 14px;
  line-height: 1.5;
}
.bp-info-banner a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
}
.bp-info-banner a:hover {
  color: var(--gold);
}

/* Filter bar */
.bp-filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.bp-filter-bar label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 600;
}
.bp-filter-bar input,
.bp-filter-bar select {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font: inherit;
  background: var(--white);
  min-width: 160px;
}
.bp-filter-bar input:focus,
.bp-filter-bar select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

/* Table */
.bp-table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}
.bp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bp-table thead th {
  text-align: left;
  background: var(--gray-50);
  color: var(--navy);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.bp-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-900);
  vertical-align: middle;
}
.bp-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.bp-table tbody tr:hover {
  background: rgba(201, 168, 76, 0.08);
}
.bp-table .bp-col-muted {
  color: var(--gray-500);
  font-size: 13px;
}
.bp-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
}

/* Cards grid */
.bp-supplier-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.bp-supplier-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.bp-supplier-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}
.bp-supplier-card h3 {
  margin: 0 0 4px 0;
  font-size: 15px;
  color: var(--navy);
}
.bp-supplier-card .bp-cnpj {
  color: var(--gray-500);
  font-size: 12px;
  font-family: monospace;
}

/* Chips (categories) */
.bp-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}

/* Source badges */
.bp-source {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.bp-source-erp         { background: rgba(10, 22, 40, 0.08); color: var(--navy); }
.bp-source-spreadsheet { background: rgba(201, 168, 76, 0.18); color: #7a6429; }
.bp-source-manual      { background: rgba(22, 163, 74, 0.12); color: var(--success); }

/* Active toggle mini-switch (styled checkbox) */
.bp-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}
.bp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.bp-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-200);
  transition: 0.2s;
  border-radius: 20px;
}
.bp-switch-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  background: var(--white);
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.bp-switch input:checked + .bp-switch-slider {
  background: var(--gold);
}
.bp-switch input:checked + .bp-switch-slider::before {
  transform: translateX(14px);
}

/* =========================================================================
   Modal system
   ========================================================================= */
.bp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 48px 16px;
  overflow-y: auto;
}
.bp-modal-backdrop.is-open {
  display: flex;
}
.bp-modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bp-modal.bp-modal-sm { max-width: 560px; }
.bp-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.bp-modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--navy);
}
.bp-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-500);
  line-height: 1;
  padding: 0 4px;
}
.bp-modal-close:hover { color: var(--navy); }
.bp-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.bp-modal-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* =========================================================================
   Tabs
   ========================================================================= */
.bp-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 16px;
}
.bp-tab {
  background: none;
  border: none;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.bp-tab:hover { color: var(--navy); }
.bp-tab.is-active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}
.bp-tab-panel { display: none; }
.bp-tab-panel.is-active { display: block; }

/* Ficha data grid */
.bp-ficha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 20px;
}
.bp-ficha-field { display: flex; flex-direction: column; }
.bp-ficha-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 2px;
}
.bp-ficha-field-value {
  color: var(--gray-900);
  font-size: 14px;
}

/* Ficha stats row */
.bp-ficha-stats {
  display: flex;
  gap: 16px;
  margin: 12px 0 20px 0;
  flex-wrap: wrap;
}
.bp-ficha-stat {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 10px 16px;
  flex: 1 1 140px;
}
.bp-ficha-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gray-500);
  font-weight: 600;
}
.bp-ficha-stat-value {
  font-size: 18px;
  color: var(--navy);
  font-weight: 700;
}

/* Action forms in Ficha */
.bp-action-form {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.bp-action-form h4 {
  margin: 0 0 10px 0;
  color: var(--navy);
  font-size: 14px;
}
.bp-action-form .form-group { margin-bottom: 10px; }
.bp-action-form .bp-action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Mapping preview table (import modal) */
.bp-mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}
.bp-mapping-table th,
.bp-mapping-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
}
.bp-mapping-table th { color: var(--navy); font-weight: 600; }
.bp-mapping-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font: inherit;
}

.bp-import-report {
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-top: 12px;
  font-size: 13px;
}
.bp-import-report strong { color: var(--navy); }

.bp-btn-danger {
  background: var(--danger);
  color: var(--white);
  border: 1px solid var(--danger);
}
.bp-btn-danger:hover { filter: brightness(0.92); }

/* =========================================================================
   SC / RFQ — kanban, status pills, SLA pills, proposal compare, timeline
   Added in Prompt 6. Reused later for orders and reports.
   ========================================================================= */

/* Status pills (SC status — 9 variants) */
.bp-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.bp-status-nao_iniciada    { background: rgba(107, 114, 128, 0.15); color: var(--gray-700); }
.bp-status-em_cotacao      { background: rgba(201, 168, 76, 0.20); color: #7a6429; }
.bp-status-em_negociacao   { background: rgba(201, 168, 76, 0.35); color: #5c4a1e; }
.bp-status-em_formalizacao { background: rgba(10, 22, 40, 0.10);  color: var(--navy); }
.bp-status-contrato_assinado { background: rgba(22, 163, 74, 0.15); color: var(--success); }
.bp-status-pedido_direto   { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.bp-status-contrato_direto { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.bp-status-atrelada_contrato { background: rgba(10, 22, 40, 0.08); color: var(--navy); }
.bp-status-cancelled       { background: rgba(220, 38, 38, 0.12); color: var(--danger); }

/* Badge auxiliar: SC atrelada a contrato de forma manual, aguardando ERP confirmar. */
.bp-badge-pending-erp-confirmation { background: rgba(217, 119, 6, 0.15); color: var(--warning); }

/* RFQ status pills (draft/open/negotiation/formalization/signed/closed) */
.bp-status-draft         { background: rgba(107, 114, 128, 0.15); color: var(--gray-700); }
.bp-status-open          { background: rgba(201, 168, 76, 0.22); color: #7a6429; }
.bp-status-negotiation   { background: rgba(201, 168, 76, 0.35); color: #5c4a1e; }
.bp-status-formalization { background: rgba(10, 22, 40, 0.10);  color: var(--navy); }
.bp-status-signed        { background: rgba(22, 163, 74, 0.15); color: var(--success); }
.bp-status-closed        { background: rgba(10, 22, 40, 0.15); color: var(--navy); }

/* SLA pill — small dot + label */
.bp-sla-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.bp-sla-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.bp-sla-pill-green  { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.bp-sla-pill-green::before  { background: var(--success); }
.bp-sla-pill-yellow { background: rgba(217, 119, 6, 0.15); color: var(--warning); }
.bp-sla-pill-yellow::before { background: var(--warning); }
.bp-sla-pill-red    { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.bp-sla-pill-red::before    { background: var(--danger); }

/* SC action row (4 small buttons for nao_iniciada) */
.bp-sc-action-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.bp-sc-action-row .btn {
  font-size: 11px;
  padding: 4px 8px;
}

/* Kanban board */
.bp-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.bp-kanban-column {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.12s, background 0.12s;
}
.bp-kanban-column.is-drop-target {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}
.bp-kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}
.bp-kanban-col-header h3 {
  margin: 0;
  font-size: 13px;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.bp-kanban-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow 0.12s, border-color 0.12s;
}
.bp-kanban-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.bp-kanban-card.is-dragging { opacity: 0.4; cursor: grabbing; }
.bp-kanban-card h4 {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: var(--navy);
}
.bp-kanban-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 6px;
}

/* Countdown badge */
.bp-countdown {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-family: monospace;
  font-size: 11px;
}
.bp-countdown.is-urgent { background: rgba(220, 38, 38, 0.15); color: var(--danger); }

/* Proposal comparison grid */
.bp-proposal-compare {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}
.bp-proposal-round {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--white);
}
.bp-proposal-round h4 {
  margin: 0 0 10px 0;
  color: var(--navy);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.bp-proposal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.bp-proposal-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--gray-50);
  font-size: 13px;
}
.bp-proposal-card h5 {
  margin: 0 0 6px 0;
  color: var(--navy);
  font-size: 13px;
}
.bp-proposal-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  font-size: 11px;
}
.bp-proposal-card dt { color: var(--gray-500); }
.bp-proposal-card dd { margin: 0; color: var(--gray-900); font-weight: 600; }
.bp-proposal-card .bp-muted { color: var(--gray-500); font-style: italic; }

/* Timeline */
.bp-timeline {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
  border-left: 2px solid var(--gray-200);
}
.bp-timeline-item {
  padding: 8px 0 8px 16px;
  position: relative;
  font-size: 13px;
}
.bp-timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
.bp-timeline-time {
  color: var(--gray-500);
  font-size: 11px;
  margin-right: 8px;
}

/* Role visibility toggle */
.bp-role-hidden { display: none !important; }

/* PDF drop zone */
.bp-pdf-drop {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--gray-500);
  transition: border-color 0.12s, background 0.12s;
  cursor: pointer;
}
.bp-pdf-drop:hover,
.bp-pdf-drop.is-drag-over {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.06);
  color: var(--navy);
}

/* Scoped RFQ detail tabs (nested inside #modal-rfq-detail) */
.bp-tab-panel-rfq { display: none; }
.bp-tab-panel-rfq.is-active { display: block; }

/* ===== Order status pills ===== */
.bp-status-not_started      { background: rgba(107,114,128,0.15); color: #374151; }
.bp-status-awaiting_docs    { background: rgba(59,130,246,0.12);  color: #1d4ed8; }
.bp-status-in_analysis      { background: rgba(59,130,246,0.20);  color: #1e40af; }
.bp-status-pending_supplier { background: rgba(245,158,11,0.15);  color: #92400e; }
.bp-status-pending_internal { background: rgba(139,92,246,0.12);  color: #6d28d9; }
.bp-status-processed        { background: rgba(22,163,74,0.15);   color: #15803d; }

/* PCO badge */
.bp-badge-pco {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  vertical-align: middle;
  margin-left: 4px;
}

/* Forecast cards row */
.bp-forecast-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.bp-forecast-card {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
}
.bp-forecast-card h3 {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bp-forecast-card .bp-forecast-total {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}
.bp-forecast-card .bp-forecast-count {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Bulk action bar */
.bp-bulk-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(201,168,76,0.10);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.bp-bulk-bar.is-visible { display: flex; }
.bp-bulk-bar span { font-size: 13px; font-weight: 600; color: var(--navy); }

/* Status history timeline (order detail modal) */
.bp-status-timeline { list-style: none; padding: 0; margin: 12px 0 0 0; }
.bp-status-timeline li {
  position: relative;
  padding: 8px 0 8px 24px;
  border-left: 2px solid var(--gray-200);
  font-size: 13px;
}
.bp-status-timeline li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
.bp-status-timeline li:last-child { border-left-color: transparent; }
.bp-status-timeline .bp-tl-label { font-weight: 600; color: var(--navy); }
.bp-status-timeline .bp-tl-time { color: var(--gray-500); font-size: 11px; margin-left: 8px; }
.bp-status-timeline .bp-tl-notes { color: var(--gray-600); font-size: 12px; display: block; margin-top: 2px; }

/* ===================================================================
   PORTAL LAYOUT (external portals — no sidebar, top header nav)
   =================================================================== */
.bp-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
}
.bp-portal-header .bp-logo { font-size: 18px; font-weight: 700; color: var(--gold); }
.bp-portal-header nav { display: flex; gap: 4px; }
.bp-portal-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.15s, border-color 0.15s;
}
.bp-portal-tab:hover { color: var(--white); }
.bp-portal-tab.is-active { color: var(--gold); border-bottom-color: var(--gold); }
.bp-portal-right { display: flex; align-items: center; gap: 16px; }
.bp-portal-user { font-size: 13px; color: var(--gold); font-weight: 600; }
.bp-portal-logout {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: var(--font);
}
.bp-portal-logout:hover { color: var(--white); border-color: rgba(255,255,255,0.5); }
.bp-portal-body {
  padding: 32px 40px 48px 40px;
  min-height: calc(100vh - 56px);
  background: var(--gray-50);
}
.bp-portal-body h1 { margin: 0 0 24px 0; color: var(--navy); font-size: 26px; font-weight: 700; }
.bp-portal-panel { display: none; }
.bp-portal-panel.is-active { display: block; }

/* CNPJ selector */
.bp-cnpj-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 24px;
}
.bp-cnpj-selector label { font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.5px; }
.bp-cnpj-selector select {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: var(--font);
}

/* ===================================================================
   AP ISSUE STATUS PILLS (mapped_status values)
   =================================================================== */
.bp-status-pending      { background: rgba(245,158,11,0.15); color: #92400e; }
.bp-status-in_treatment { background: rgba(59,130,246,0.20);  color: #1e40af; }
.bp-status-resolved     { background: rgba(22,163,74,0.15);   color: #15803d; }
.bp-status-cancelled    { background: rgba(107,114,128,0.15); color: #374151; }

/* Pending reason badges */
.bp-reason-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--gray-100);
  color: var(--gray-700);
}
.bp-reason-valor_divergente           { background: rgba(220,38,38,0.12); color: #991b1b; }
.bp-reason-cnpj_divergente            { background: rgba(220,38,38,0.12); color: #991b1b; }
.bp-reason-doc_sem_pedido             { background: rgba(245,158,11,0.15); color: #92400e; }
.bp-reason-boleto_ausente             { background: rgba(139,92,246,0.12); color: #6d28d9; }
.bp-reason-boleto_vencimento_incorreto { background: rgba(139,92,246,0.12); color: #6d28d9; }
.bp-reason-outros                     { background: var(--gray-100); color: var(--gray-700); }

/* ===================================================================
   COMMENTS THREAD (AP issue detail modal)
   =================================================================== */
.bp-comments-thread {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
}
.bp-comment {
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
}
.bp-comment-auto { border-left-color: var(--gray-300); background: var(--gray-100); }
.bp-comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 11px;
}
.bp-comment-author { font-weight: 700; color: var(--navy); }
.bp-comment-time { color: var(--gray-500); }
.bp-comment-text { font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.bp-comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.bp-comment-form textarea {
  flex: 1;
  min-height: 60px;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  resize: vertical;
}
.bp-comment-form .btn { align-self: flex-end; }

/* ===================================================================
   ANALYSIS RESULT CARD (document analyzer output)
   =================================================================== */
.bp-analysis-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: var(--white);
  margin-top: 12px;
}
.bp-analysis-card h4 { margin: 0 0 12px 0; font-size: 14px; color: var(--navy); }
.bp-analysis-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.bp-analysis-fields dt { font-weight: 600; color: var(--gray-700); }
.bp-analysis-fields dd { color: var(--gray-900); margin: 0; }
.bp-discrepancy {
  padding: 6px 10px;
  margin-top: 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.bp-discrepancy-high   { background: rgba(220,38,38,0.10); color: #991b1b; }
.bp-discrepancy-medium { background: rgba(245,158,11,0.10); color: #92400e; }
.bp-discrepancy-low    { background: rgba(59,130,246,0.10); color: #1e40af; }

/* ===================================================================
   ADMIN PANEL — company cards, plan badges, search input
   =================================================================== */
.bp-admin-company-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 960px) {
  .bp-admin-company-grid { grid-template-columns: 1fr; }
}
.bp-admin-card {
  position: relative;
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 20px 16px 20px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.bp-admin-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--gold);
}
.bp-admin-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.bp-admin-card-name {
  font-size: 16px; font-weight: 700; color: var(--navy);
}
.bp-admin-card-row {
  font-size: 13px; color: var(--gray-500); margin-top: 4px;
}
.bp-admin-card-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.bp-admin-card-stats span { color: var(--navy); font-weight: 500; }
.bp-admin-card-meta {
  margin-top: 10px; font-size: 12px; color: var(--gray-500);
}
.bp-admin-card-action {
  position: absolute; top: 14px; right: 16px;
  font-size: 12px; font-weight: 600; color: var(--gold);
  background: rgba(201,168,76,0.10);
  padding: 4px 10px; border-radius: 12px;
}

.bp-admin-plan-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px;
}
.bp-admin-plan-starter    { background: rgba(107,114,128,0.15); color: #374151; }
.bp-admin-plan-pro        { background: rgba(59,130,246,0.14);  color: #1d4ed8; }
.bp-admin-plan-business   { background: rgba(22,163,74,0.14);   color: #15803d; }
.bp-admin-plan-enterprise { background: rgba(139,92,246,0.14);  color: #6d28d9; }
.bp-admin-plan-partner    { background: rgba(201,168,76,0.18);  color: #7a5f19; }

.bp-admin-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 360px; position: relative;
}
.bp-admin-search input {
  width: 100%; padding: 8px 10px 8px 32px;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  font-family: var(--font); font-size: 13px;
}
.bp-admin-search input:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(10,22,40,0.12);
}
.bp-admin-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--gray-500); pointer-events: none; display: inline-flex;
}

.bp-admin-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--gold); margin: 0 0 8px 0;
  padding-bottom: 6px; border-bottom: 1px solid var(--gray-100);
}

.bp-admin-breadcrumb {
  font-size: 13px; color: var(--gray-500); margin-bottom: 8px;
}
.bp-admin-breadcrumb a { color: var(--navy); text-decoration: none; font-weight: 500; }
.bp-admin-breadcrumb a:hover { color: var(--gold); }
.bp-admin-breadcrumb .sep { margin: 0 8px; color: var(--gray-400); }

/* Role badges (empresa page users table) */
.bp-role-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; color: #fff;
}
.bp-role-comprador      { background: #3B82F6; }
.bp-role-gestor         { background: #8B5CF6; }
.bp-role-solicitante    { background: #10B981; }
.bp-role-fornecedor     { background: #F59E0B; color: #0A1628; }
.bp-role-contas_a_pagar { background: #F97316; }
.bp-role-admin          { background: #0A1628; }

.bp-row-inactive { opacity: 0.55; }

/* Toggle switch */
.bp-switch {
  position: relative; display: inline-block; width: 40px; height: 22px;
  vertical-align: middle;
}
.bp-switch input { opacity: 0; width: 0; height: 0; }
.bp-switch-slider {
  position: absolute; inset: 0; background: var(--gray-300);
  border-radius: 22px; cursor: pointer; transition: background 0.2s;
}
.bp-switch-slider::before {
  content: ""; position: absolute;
  left: 3px; top: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.bp-switch input:checked + .bp-switch-slider { background: var(--gold); }
.bp-switch input:checked + .bp-switch-slider::before { transform: translateX(18px); }

/* ===================================================================
   SUPPLIER PORTAL IDENTITY STRIP (CNPJ + Razão Social)
   =================================================================== */
.bp-supplier-identity {
  background: #122440;
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 40px;
  letter-spacing: 0.3px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bp-supplier-identity .subtle {
  color: rgba(201,168,76,0.75);
  font-weight: 500;
}

/* ────────────────────────────────────────────────────────────────
   Melhoria 7 — Dashboard redesigned (action-oriented command center)
   ──────────────────────────────────────────────────────────────── */
#dashboard-wrapper { display: flex; flex-direction: column; gap: 16px; padding: 16px 0; }

#dashboard-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
#greeting-text { font-size: 20px; font-weight: 500; color: var(--navy); margin: 0; }
#alert-count-summary { font-size: 12px; color: var(--gray-500); margin: 4px 0 0 0; }
.btn-approvals-shortcut {
  font-size: 13px; padding: 7px 14px;
  border: 1px solid var(--navy); border-radius: 6px;
  color: var(--navy); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.btn-approvals-shortcut:hover { background: var(--navy); color: #fff; }

.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--gray-500); margin-bottom: 8px;
}
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kpi-card {
  background: var(--gray-50); border-radius: 8px;
  padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--gray-200);
  transition: background .15s;
}
.kpi-card:hover { background: var(--gray-100); }
.kpi-label { font-size: 11px; color: var(--gray-500); margin-bottom: 4px; }
.kpi-value { font-size: 24px; font-weight: 500; color: var(--navy); }
.kpi-value.crit { color: #A32D2D; }
.kpi-value.warn { color: #BA7517; }
.kpi-value.ok   { color: #3B6D11; }
.kpi-sub { font-size: 11px; color: var(--gray-500); margin-top: 3px; }

.card-full, .card-half {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 14px 16px;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }

.sla-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.sla-dot-critical { background: #E24B4A; }
.sla-dot-warning  { background: #EF9F27; }
.sla-dot-ok       { background: #639922; }

.alert-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
}
.alert-row:last-child { border-bottom: none; }
.alert-row:hover .alert-title { text-decoration: underline; }
.alert-body { flex: 1; }
.alert-title { font-size: 13px; font-weight: 500; color: var(--navy); display: block; }
.alert-desc  { font-size: 11px; color: var(--gray-500); }
.badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge-critical { background: #FCEBEB; color: #A32D2D; }
.badge-warning  { background: #FAEEDA; color: #BA7517; }
.badge-ok       { background: #EAF3DE; color: #3B6D11; }

.dashboard-bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.perf-numbers { display: flex; gap: 12px; margin-bottom: 12px; }
.perf-item { flex: 1; background: var(--gray-50); border-radius: 6px; padding: 10px 12px; }
.perf-value { font-size: 20px; font-weight: 500; color: var(--navy); }
.perf-value.kpi-ok { color: #3B6D11; }
.perf-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

.bars-block { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-label-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--gray-500); }
.bar-track { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 3px; transition: width .4s ease; }

.shortcut-list { display: flex; flex-direction: column; gap: 0; }
.shortcut-link {
  display: block; font-size: 13px; color: var(--navy);
  padding: 8px 0; border-bottom: 1px solid var(--gray-200);
  text-decoration: none;
}
.shortcut-link:last-child { border-bottom: none; }
.shortcut-link:hover { text-decoration: underline; }

.supplier-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
}
.supplier-row:last-child { border-bottom: none; }
.supplier-name { color: var(--navy); }

.activity-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
}
.activity-row:last-child { border-bottom: none; }
.act-icon {
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  background: var(--gray-50); display: flex;
  align-items: center; justify-content: center; font-size: 14px;
}
.act-body { flex: 1; }
.act-desc { font-size: 12px; color: var(--gray-500); }
.act-desc strong { color: var(--navy); }
.act-link { color: var(--navy); font-weight: 500; text-decoration: none; }
.act-link:hover { text-decoration: underline; }
.act-time { font-size: 10px; color: var(--gray-500); margin-top: 2px; }

.empty-state { font-size: 13px; color: var(--gray-500); padding: 8px 0; }
.ok-state { color: #3B6D11; }

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-bottom-row { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────────────────────────
   Melhoria 8 Phase 3 — Financial dashboard (filters + 4 KPIs + pipeline)
   ──────────────────────────────────────────────────────────────── */

/* Sticky filter bar */
.bp-financial-filters {
  position: sticky; top: 0; z-index: 10;
  background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: end; gap: 12px; flex-wrap: wrap;
  padding: 12px 4px; margin-bottom: 16px;
}
.bp-ff-field { display: flex; flex-direction: column; gap: 4px; }
.bp-ff-field > span { font-size: 11px; color: var(--gray-500); }
.bp-ff-field select, .bp-ff-field input {
  padding: 6px 10px; border: 1px solid var(--gray-200);
  border-radius: 6px; font-size: 13px; min-width: 160px;
}
.bp-ff-summary {
  margin-left: auto; font-size: 12px; color: var(--gray-500); font-style: italic;
}

/* 4 KPI cards */
.bp-financial-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.bp-fkpi {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 16px; cursor: pointer; transition: box-shadow .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.bp-fkpi:hover { box-shadow: var(--shadow-md); }
.bp-fkpi-label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.bp-fkpi-value { font-size: 22px; font-weight: 600; color: var(--navy); margin-top: 4px; }
.bp-fkpi-sub { font-size: 11px; color: var(--gray-500); }
.bp-fkpi-yoy { font-size: 11px; margin-top: 4px; }
.bp-fkpi-yoy.yoy-up   { color: #2e8b57; }
.bp-fkpi-yoy.yoy-down { color: #c0392b; }

.bp-fkpi-gold .bp-fkpi-value { color: #BA7517; }
.bp-fkpi-budget.color-green  .bp-fkpi-value { color: #2e8b57; }
.bp-fkpi-budget.color-yellow .bp-fkpi-value { color: #BA7517; }
.bp-fkpi-budget.color-red    .bp-fkpi-value { color: #c0392b; }
.bp-fkpi-budget.color-neutral .bp-fkpi-value { color: var(--gray-500); }
.bp-fkpi-value.alert-badge::after {
  content: " ⚠ ATENÇÃO"; font-size: 10px; vertical-align: middle;
  background: #c0392b; color: #fff; padding: 2px 6px; border-radius: 4px;
  margin-left: 6px;
}

/* Segmented bar inside Card 4 */
.budget-bar {
  display: flex; height: 8px; background: var(--gray-100);
  border-radius: 4px; overflow: hidden; margin-top: 10px;
}
.segment-realized  { background: var(--navy); }
.segment-committed { background: #d4a84b; }
.segment-available { background: var(--gray-200); }
.budget-bar-legend {
  display: flex; gap: 12px; margin-top: 6px;
  font-size: 10px; color: var(--gray-500);
}
.budget-bar-legend i.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  margin-right: 4px; vertical-align: middle;
}
.budget-bar-legend i.dot-realized  { background: var(--navy); }
.budget-bar-legend i.dot-committed { background: #d4a84b; }
.budget-bar-legend i.dot-available { background: var(--gray-200); }

/* Pipeline */
.bp-pipeline-section { margin-bottom: 24px; }
.bp-section-title { font-size: 16px; color: var(--navy); margin: 0 0 10px; }
.bp-pipeline-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.bp-pipeline-card {
  display: block; padding: 14px; border-radius: 8px;
  text-decoration: none; color: #fff; transition: transform .12s;
  background: var(--navy);
}
.bp-pipeline-card:hover { transform: translateY(-2px); }
/* Gradient navy → gold across the 5 stages */
.bp-pipeline-card.stage-1 { background: #0A1628; }
.bp-pipeline-card.stage-2 { background: #2a3856; }
.bp-pipeline-card.stage-3 { background: #6b6a4d; }
.bp-pipeline-card.stage-4 { background: #a89240; }
.bp-pipeline-card.stage-5 { background: #C9A84C; color: #0A1628; }
.bp-pl-label { font-size: 11px; opacity: .85; text-transform: uppercase; letter-spacing: .04em; }
.bp-pl-count { font-size: 22px; font-weight: 600; margin-top: 4px; }
.bp-pl-value { font-size: 12px; opacity: .9; margin-top: 2px; }

/* "Outros caminhos" expandable */
.bp-pipeline-others {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 8px; padding: 10px 14px;
}
.bp-pipeline-others summary {
  cursor: pointer; font-size: 13px; color: var(--gray-700);
  list-style: none;
}
.bp-pipeline-others summary::before { content: "▸ "; }
.bp-pipeline-others[open] summary::before { content: "▾ "; }
.bp-pipeline-others-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 10px;
}
.bp-pipeline-other-card {
  display: block; padding: 10px; border-radius: 6px;
  background: #fff; border: 1px solid var(--gray-200);
  text-decoration: none; color: var(--navy);
}
.bp-pipeline-other-card:hover { background: var(--gray-100); }

.bp-section-placeholder {
  background: var(--gray-50); border: 1px dashed var(--gray-200);
  border-radius: 8px; padding: 14px; margin-bottom: 16px;
}

/* Mobile */
@media (max-width: 768px) {
  .bp-financial-kpis { grid-template-columns: repeat(2, 1fr); }
  .bp-pipeline-grid { grid-template-columns: 1fr; gap: 6px; }
  .bp-pipeline-others-grid { grid-template-columns: repeat(2, 1fr); }
  .bp-financial-filters { position: static; }
}

/* ────────────────────────────────────────────────────────────────
   Phase 4 — Forecast column chart + upcoming installments + drill-down modal
   ──────────────────────────────────────────────────────────────── */

.bp-forecast-section { margin-bottom: 20px; }
.bp-forecast-chart {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 16px; min-height: 180px;
}
.bp-forecast-cols {
  display: flex; align-items: flex-end; gap: 8px; height: 200px;
}
.bp-forecast-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; min-width: 0;
}
.bp-forecast-value-label {
  font-size: 10px; color: var(--gray-500); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.bp-forecast-bar {
  width: 70%; min-height: 2px; max-height: 100%;
  background: linear-gradient(180deg, var(--gold) 0%, var(--navy) 100%);
  border-radius: 4px 4px 0 0; transition: height .3s;
}
.bp-forecast-month {
  font-size: 10px; color: var(--gray-700); margin-top: 6px;
  text-transform: uppercase;
}

/* Upcoming installments mini-table */
.bp-upcoming-section { margin-bottom: 20px; }
.bp-upcoming-table tr.bp-upcoming-urgent { background: #fef2f2; }
.bp-upcoming-table tr.bp-upcoming-urgent td { color: #991b1b; font-weight: 500; }
.bp-upcoming-table tr.bp-upcoming-warn { background: #fffbeb; }
.bp-upcoming-table tr.bp-upcoming-warn td { color: #92400e; }
.bp-upcoming-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 12px; font-size: 13px;
}
.bp-upcoming-pagination button[disabled] {
  opacity: .4; cursor: not-allowed;
}

/* Drill-down modal */
.bp-drill-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(17, 24, 39, .55); z-index: 1100;
  align-items: flex-start; justify-content: center;
  padding-top: 5vh;
}
.bp-drill-modal.open { display: flex; }
.bp-drill-modal-card {
  background: #fff; border-radius: 12px; width: 92%; max-width: 760px;
  max-height: 85vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.bp-drill-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-200);
}
.bp-drill-modal-header h2 { margin: 0; font-size: 18px; color: var(--navy); }
.bp-drill-modal-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--gray-500); line-height: 1;
}
.bp-drill-modal-close:hover { color: var(--navy); }
.bp-drill-modal-tabs {
  display: flex; gap: 4px; padding: 0 18px;
  border-bottom: 1px solid var(--gray-200);
}
.bp-drill-modal-tabs:empty { display: none; }
.bp-drill-tab {
  background: none; border: none; padding: 10px 16px;
  font-size: 13px; color: var(--gray-500); cursor: pointer;
  border-bottom: 2px solid transparent;
}
.bp-drill-tab.is-active {
  color: var(--navy); border-bottom-color: var(--gold);
}
.bp-drill-modal-body {
  padding: 14px 18px; overflow-y: auto; flex: 1;
}

@media (max-width: 768px) {
  .bp-forecast-cols { gap: 4px; height: 160px; }
  .bp-forecast-value-label { display: none; }
  .bp-drill-modal-card { width: 96%; max-height: 90vh; }
}

/* ────────────────────────────────────────────────────────────────
   Phase 2 — Bulk upload de Orcamentos modal (3 steps)
   ──────────────────────────────────────────────────────────────── */
.bp-bulk-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(17, 24, 39, .55); z-index: 1100;
  align-items: flex-start; justify-content: center; padding-top: 4vh;
}
.bp-bulk-modal.open { display: flex; }
.bp-bulk-card {
  background: #fff; border-radius: 12px; width: 92%; max-width: 880px;
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.bp-bulk-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-200);
}
.bp-bulk-header h2 { margin: 0; font-size: 16px; color: var(--navy); }
.bp-bulk-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--gray-500); line-height: 1;
}
.bp-bulk-step { padding: 16px 18px; overflow-y: auto; flex: 1; }
.bp-bulk-step input[type="file"] {
  display: block; padding: 10px; border: 1px dashed var(--gray-300);
  border-radius: 6px; width: 100%; font-size: 13px;
}
.bp-bulk-error { color: #c0392b; font-size: 13px; margin-top: 8px; min-height: 18px; }
.bp-bulk-summary {
  font-size: 13px; padding: 8px 12px; background: var(--gray-50);
  border-radius: 6px; margin-bottom: 10px;
}
.bp-bulk-filter {
  display: flex; gap: 16px; font-size: 12px; color: var(--gray-700);
  margin-bottom: 8px;
}
.bp-bulk-preview-table { font-size: 12px; }
.bp-bulk-preview-table tr.bulk-row-error   { background: #fef2f2; }
.bp-bulk-preview-table tr.bulk-row-error td { color: #991b1b; }
.bp-bulk-preview-table tr.bulk-row-warning { background: #fffbeb; }
.bp-bulk-preview-table tr.bulk-row-warning td { color: #92400e; }
.bp-bulk-preview-table tr.bulk-row-ok td { color: var(--navy); }
.bp-bulk-result {
  font-size: 16px; padding: 24px; text-align: center;
  background: #ecfdf5; border-radius: 8px; color: #065f46;
}
.bp-bulk-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--gray-200);
}
