/* Cockpit Comercial — estilos específicos. Depende de v2-palato.css. */

.cockpit-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.cockpit-header h1 {
  margin-top: 6px; color: var(--pl-text);
  font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -.035em; line-height: 1.1;
}
.cockpit-lede {
  margin-top: 4px; color: var(--pl-text-muted);
  font-size: 13px; max-width: 580px;
}
.cockpit-quick-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cockpit-btn-primary,
.cockpit-btn-primary:visited {
  background: var(--pl-wine);
  border-color: var(--pl-wine);
  color: #fff !important;
}
.cockpit-btn-primary:hover {
  background: var(--pl-wine-dark);
  color: #fff !important;
}
.cockpit-btn-secondary,
.cockpit-btn-secondary:visited {
  background: #fff;
  border-color: var(--pl-wine);
  color: var(--pl-wine) !important;
}
.cockpit-btn-primary span,
.cockpit-btn-secondary span {
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.cockpit-inline-icon {
  background: currentColor;
  border-radius: 999px;
  color: inherit;
  display: inline-block;
  height: 7px;
  margin-right: 8px;
  overflow: hidden;
  text-indent: -999px;
  transform: translateY(-1px);
  width: 7px;
}

.cockpit-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px;
}
.cockpit-col-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cockpit-col-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.cockpit-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}

.cockpit-pipeline { padding: 14px 16px; }
.cockpit-pipeline .pl-stage-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: visible;
  padding-bottom: 0;
}
.cockpit-pipeline .pl-stage {
  border-radius: 10px;
  min-width: 0;
  padding: 12px 12px;
}
.cockpit-pipeline .pl-stage:hover {
  box-shadow: none;
  transform: none;
}
.cockpit-pipeline .pl-stage.is-active {
  background: #fff;
  border-color: var(--pl-border);
}
.cockpit-pipeline .pl-stage__count {
  font-size: 22px;
}
.cockpit-pipeline .pl-stage__label {
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-pipeline .pl-stage__bar {
  display: none;
}

.cockpit-insights {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.cockpit-insight {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; position: relative; overflow: hidden;
}
.cockpit-insight::after {
  content: ""; position: absolute; top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle at top right, rgba(92, 29, 74, .06), transparent 70%);
  pointer-events: none;
}
.cockpit-insight h3 { font-size: 14px; font-weight: 700; color: var(--pl-text); margin: 0; }
.cockpit-insight__metric {
  font-size: 22px; font-weight: 900; color: var(--pl-wine);
  letter-spacing: -.02em; line-height: 1; margin-top: 2px;
}
.cockpit-insight__metric span.pl-kicker {
  font-size: 12px; font-weight: 600; color: var(--pl-text-muted);
  margin-left: 5px; letter-spacing: 0;
}
.cockpit-insight__bar {
  height: 4px; background: var(--pl-surface-soft); border-radius: 999px;
  margin-top: 6px; overflow: hidden;
}
.cockpit-insight__bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--pl-wine) 0%, #8c4675 100%);
  border-radius: inherit;
}
.cockpit-insight__sub { font-size: 12px; color: var(--pl-text-subtle); margin: 0; }

.cockpit-footer {
  margin-top: 16px; text-align: center;
  font-size: 11px; color: var(--pl-text-faint);
}
.cockpit-footer a { color: var(--pl-wine); font-weight: 700; margin-left: 4px; }
.cockpit-footer a:hover { text-decoration: underline; }

.pl-hero[data-status="warning"] {
  background: linear-gradient(135deg, #fff 0%, #fff8eb 100%);
  border-color: #f3dfb6; border-left-color: var(--pl-warning);
}
.pl-hero[data-status="warning"] h1 { color: var(--pl-warning); }
.pl-hero[data-status="warning"] .pl-hero__value strong { color: var(--pl-warning); }

.pl-hero[data-status="critical"] {
  background: linear-gradient(135deg, #fff 0%, #fff1f2 100%);
  border-color: #f4cccd; border-left-color: var(--pl-danger);
}
.pl-hero[data-status="critical"] h1 { color: var(--pl-danger); }
.pl-hero[data-status="critical"] .pl-hero__value strong { color: var(--pl-danger); }

@media (max-width: 1180px) {
  .cockpit-grid { grid-template-columns: 1fr; }
  .cockpit-col-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 720px) {
  .cockpit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cockpit-pipeline .pl-stage-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cockpit-insights { grid-template-columns: 1fr; }
  .cockpit-header { flex-direction: column; align-items: stretch; }
  .cockpit-quick-actions { justify-content: flex-start; }
}
