/* ===== Gestão de vendas — layout fiel ao mock ===== */

#gc-section-vendas.gc-gv-section {
    --gv-navy: #0f172a;
    --gv-muted: #64748b;
    --gv-border: #eef2f7;
    --gv-card: #fff;
}

.gc-gv-dash {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gc-gv-kpis-top,
.gc-gv-kpis-sec {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.gc-gv-kpi {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--gv-card);
    border: 1px solid var(--gv-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    padding: 16px;
    min-width: 0;
}

.gc-gv-kpi--lg { min-height: 112px; }
.gc-gv-kpi--sm { min-height: 88px; padding: 14px; }

.gc-gv-kpi__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.05rem;
}

.gc-gv-kpi--red .gc-gv-kpi__icon { background: #fee2e2; color: #e63946; }
.gc-gv-kpi--green .gc-gv-kpi__icon { background: #dcfce7; color: #16a34a; }
.gc-gv-kpi--blue .gc-gv-kpi__icon { background: #dbeafe; color: #2563eb; }
.gc-gv-kpi--orange .gc-gv-kpi__icon { background: #ffedd5; color: #ea580c; }
.gc-gv-kpi--purple .gc-gv-kpi__icon { background: #ede9fe; color: #7c3aed; }
.gc-gv-kpi--pink .gc-gv-kpi__icon { background: #fce7f3; color: #db2777; }

.gc-gv-kpi__body { min-width: 0; }
.gc-gv-kpi__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gv-muted);
}
.gc-gv-kpi__value {
    margin-top: 4px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gv-navy);
    letter-spacing: -0.02em;
    line-height: 1.15;
    word-break: break-word;
}
.gc-gv-kpi--sm .gc-gv-kpi__value { font-size: 1.15rem; }
.gc-gv-kpi__delta {
    margin-top: 6px;
    font-size: 0.76rem;
    font-weight: 700;
}
.gc-gv-kpi__delta.is-up { color: #16a34a; }
.gc-gv-kpi__delta.is-down { color: #dc2626; }
.gc-gv-kpi__delta.is-flat { color: #94a3b8; }
.gc-gv-kpi__sub {
    margin-top: 4px;
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 500;
}

.gc-gv-card {
    background: var(--gv-card);
    border: 1px solid var(--gv-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    padding: 16px 18px;
    min-width: 0;
}

.gc-gv-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.gc-gv-card__head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--gv-navy);
}

.gc-gv-card__sub {
    margin: 0 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
}

.gc-gv-muted {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.gc-gv-funil-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    align-items: stretch;
}

.gc-gv-chart {
    position: relative;
    min-height: 220px;
}
.gc-gv-chart--funil { min-height: 260px; }
.gc-gv-chart--tall { min-height: 240px; }
.gc-gv-chart--wide { min-height: 280px; }
.gc-gv-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.gc-gv-table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gc-gv-seg,
.gc-gv-export {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.gc-gv-seg.is-active {
    background: #fce7f3;
    border-color: #f9a8d4;
    color: #be185d;
}

.gc-gv-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gc-gv-export:hover,
.gc-gv-seg:hover { background: #f8fafc; }
.gc-gv-seg.is-active:hover { background: #fce7f3; }

.gc-gv-table-wrap {
    overflow: auto;
    max-height: 480px;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
}

.gc-gv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.gc-gv-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: var(--gv-muted);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    padding: 10px 10px;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

.gc-gv-table th:not(:first-child),
.gc-gv-table td:not(:first-child) {
    text-align: right;
}

.gc-gv-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    white-space: nowrap;
}

.gc-gv-table tr.gc-gv-total td {
    background: #eff6ff;
    font-weight: 800;
    color: #1d4ed8;
    border-bottom: 0;
    position: sticky;
    bottom: 0;
}

.gc-gv-consultora {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--gv-navy);
}

.gc-gv-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fee2e2;
    color: #e63946;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

.gc-gv-pct.is-good { color: #16a34a; font-weight: 700; }
.gc-gv-pct.is-warn { color: #ca8a04; font-weight: 700; }
.gc-gv-pct.is-bad { color: #dc2626; font-weight: 700; }

.gc-gv-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    background: #64748b;
}
.gc-gv-score.is-a { background: #16a34a; }
.gc-gv-score.is-b { background: #2563eb; }
.gc-gv-score.is-c { background: #d97706; }
.gc-gv-score.is-d { background: #dc2626; }

.gc-gv-intel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.gc-gv-intel-grid--2 {
    margin-top: 12px;
}

.gc-gv-panel {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    min-width: 0;
}

.gc-gv-panel h4 {
    margin: 0 0 8px;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--gv-navy);
}

#gc-section-vendas .gc-compare-meses-toolbar {
    margin: 8px 0 10px;
}

@media (max-width: 1200px) {
    .gc-gv-funil-grid { grid-template-columns: 1fr; }
    .gc-gv-kpis-top,
    .gc-gv-kpis-sec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .gc-gv-kpis-top,
    .gc-gv-kpis-sec,
    .gc-gv-intel-grid { grid-template-columns: 1fr; }
}

[data-theme="dark"] #gc-section-vendas.gc-gv-section {
    --gv-navy: var(--text-primary, #e2e8f0);
    --gv-card: var(--bg-card, #1e293b);
    --gv-border: var(--border, #334155);
}

[data-theme="dark"] .gc-gv-kpi,
[data-theme="dark"] .gc-gv-card,
[data-theme="dark"] .gc-gv-panel,
[data-theme="dark"] .gc-gv-seg,
[data-theme="dark"] .gc-gv-export {
    background: var(--bg-card, #1e293b);
}

[data-theme="dark"] .gc-gv-table th {
    background: #0f172a;
}
