/* ==========================================================================
   AUDIT & BEHAVIORAL DIAGNOSTICS MODULES (sup_audit & admin_audit)
   Enterprise CRM Design System - Brasil Componentes
   ========================================================================== */

/* Main Container */
.audit-module-container {
    padding: 0.5rem 0 3rem 0;
    max-width: 1440px;
    margin: 0 auto;
    font-family: var(--font-family, inherit);
}

/* Header & Controls */
.audit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.audit-title-box h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.audit-title-box p {
    color: var(--text-muted, #64748b);
    font-size: 0.925rem;
    margin: 0;
    max-width: 820px;
    line-height: 1.45;
}

/* Control Toolbar */
.audit-toolbar-card {
    background: var(--surface, #ffffff);
    border: 1.5px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.audit-toolbar-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
}

.audit-input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.audit-select,
.audit-date-input {
    height: 42px;
    padding: 0 0.85rem;
    border: 1.5px solid var(--border-color, #cbd5e1);
    border-radius: var(--radius-sm, 8px);
    font-size: 0.875rem;
    font-weight: 600;
    background: #ffffff;
    color: var(--text-main, #0f172a);
    transition: all 0.2s ease;
}

.audit-select:focus,
.audit-date-input:focus {
    border-color: var(--primary, #059669);
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Representative Quick Summary Card */
.audit-rep-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: var(--radius-lg, 16px);
    padding: 1.5rem 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.audit-rep-hero-card::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.25) 0%, rgba(5, 150, 105, 0) 70%);
    pointer-events: none;
}

.audit-rep-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.audit-rep-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
    border: 3px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.audit-rep-info h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 0.35rem 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.audit-rep-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.audit-tag-dark {
    font-size: 0.775rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.audit-tag-dark.highlight {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.4);
}

.audit-rep-quick-kpis {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.audit-quick-kpi-item {
    text-align: right;
}

.audit-quick-kpi-label {
    font-size: 0.725rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.audit-quick-kpi-val {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.audit-quick-kpi-val.emerald {
    color: #34d399;
}

/* ==========================================================================
   FUNNEL DE CONVERSÃO DIÁRIO (Visual & Interativo)
   ========================================================================== */
.audit-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid var(--border-subtle, #f1f5f9);
}

.audit-funnel-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
}

.audit-funnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    position: relative;
    margin-bottom: 1.5rem;
}

.audit-funnel-step {
    background: var(--surface-subtle, #f8fafc);
    border: 1.5px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 1.25rem;
    position: relative;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.audit-funnel-step:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.audit-funnel-step.step-1 { border-top: 4px solid #3b82f6; }
.audit-funnel-step.step-2 { border-top: 4px solid #8b5cf6; }
.audit-funnel-step.step-3 { border-top: 4px solid #059669; }
.audit-funnel-step.step-4 { border-top: 4px solid #f59e0b; }
.audit-funnel-step.step-5 { border-top: 4px solid #0284c7; }

.funnel-step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.funnel-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.funnel-step-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.35rem;
}

.funnel-step-count {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.funnel-step-meta {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed #e2e8f0;
    padding-top: 0.6rem;
    margin-top: 0.5rem;
}

.funnel-rate-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
}

.funnel-rate-badge.green { background: #ecfdf5; color: #059669; }
.funnel-rate-badge.amber { background: #fffbeb; color: #d97706; }
.funnel-rate-badge.red   { background: #fef2f2; color: #dc2626; }
.funnel-rate-badge.blue  { background: #eff6ff; color: #2563eb; }

/* Visual Funnel Bar */
.audit-funnel-bar-container {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audit-funnel-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audit-funnel-bar-label {
    width: 170px;
    font-size: 0.825rem;
    font-weight: 700;
    color: #334155;
    flex-shrink: 0;
}

.audit-funnel-bar-track {
    flex: 1;
    height: 16px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.audit-funnel-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.audit-funnel-bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.audit-funnel-bar-fill.purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.audit-funnel-bar-fill.emerald { background: linear-gradient(90deg, #059669, #34d399); }

.audit-funnel-bar-val {
    width: 90px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
    text-align: right;
    flex-shrink: 0;
}

/* ==========================================================================
   CARDS DE MÉTRICAS COMPORTAMENTAIS
   ========================================================================== */
.audit-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.audit-metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
    transition: all 0.2s ease;
}

.audit-metric-card:hover {
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.07));
    border-color: #cbd5e1;
}

.audit-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.audit-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.audit-metric-icon.blue   { background: #eff6ff; color: #2563eb; }
.audit-metric-icon.amber  { background: #fffbeb; color: #d97706; }
.audit-metric-icon.purple { background: #f5f3ff; color: #7c3aed; }
.audit-metric-icon.red    { background: #fef2f2; color: #dc2626; }
.audit-metric-icon.green  { background: #ecfdf5; color: #059669; }

.audit-metric-name {
    font-size: 0.825rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.audit-metric-number {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin: 0.25rem 0;
}

.audit-metric-sub {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ==========================================================================
   MATRIZ DE PERFIS COMPORTAMENTAIS (5 CARDS SELECIONÁVEIS)
   ========================================================================== */
.audit-profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.audit-profile-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md, 14px);
    padding: 1.4rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.audit-profile-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08);
}

.audit-profile-card.selected {
    border-width: 2.5px;
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.12);
}

/* Card Themes */
.audit-profile-card.profile-tirador {
    border-color: #fde68a;
    background: #fffdfa;
}
.audit-profile-card.profile-tirador.selected {
    border-color: #d97706;
    background: #fffbeb;
}

.audit-profile-card.profile-gargalo {
    border-color: #fed7aa;
    background: #fffbf7;
}
.audit-profile-card.profile-gargalo.selected {
    border-color: #ea580c;
    background: #fff7ed;
}

.audit-profile-card.profile-inseguro {
    border-color: #ddd6fe;
    background: #faf8ff;
}
.audit-profile-card.profile-inseguro.selected {
    border-color: #7c3aed;
    background: #f5f3ff;
}

.audit-profile-card.profile-inimigo {
    border-color: #fecdd3;
    background: #fff8f9;
}
.audit-profile-card.profile-inimigo.selected {
    border-color: #e11d48;
    background: #fff1f2;
}

.audit-profile-card.profile-consultor {
    border-color: #a7f3d0;
    background: #f8fdfb;
}
.audit-profile-card.profile-consultor.selected {
    border-color: #059669;
    background: #ecfdf5;
}

.audit-profile-badge {
    position: absolute;
    top: -12px;
    right: 16px;
    font-size: 0.725rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: none;
}

.audit-profile-card.selected .audit-profile-badge {
    display: block;
}

.audit-profile-card.suggested::before {
    content: '⚡ Sugestão dos Dados';
    position: absolute;
    top: -12px;
    left: 16px;
    font-size: 0.725rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    background: #0f172a;
    color: #ffffff;
    letter-spacing: 0.03em;
}

.audit-profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.audit-profile-emoji {
    font-size: 1.8rem;
    line-height: 1;
}

.audit-profile-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.audit-profile-body {
    margin-bottom: 1rem;
}

.audit-symptom-box {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
}

.audit-symptom-title {
    font-size: 0.725rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.audit-symptom-text {
    font-size: 0.825rem;
    color: #334155;
    line-height: 1.4;
    margin: 0;
}

.audit-action-box {
    background: rgba(255, 255, 255, 0.9);
    border-left: 3px solid #059669;
    border-radius: 0 8px 8px 0;
    padding: 0.65rem 0.85rem;
}

.audit-profile-tirador .audit-action-box { border-left-color: #d97706; }
.audit-profile-gargalo .audit-action-box { border-left-color: #ea580c; }
.audit-profile-inseguro .audit-action-box { border-left-color: #7c3aed; }
.audit-profile-inimigo .audit-action-box { border-left-color: #e11d48; }
.audit-profile-consultor .audit-action-box { border-left-color: #059669; }

.audit-action-title {
    font-size: 0.725rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.audit-action-text {
    font-size: 0.825rem;
    color: #1e293b;
    line-height: 1.4;
    margin: 0;
    font-weight: 600;
}

/* ==========================================================================
   FORMULÁRIO DE PARECER DA SUPERVISÃO & CHECKLIST
   ========================================================================== */
.audit-form-card {
    background: #ffffff;
    border: 1.5px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 14px);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
}

.audit-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .audit-form-grid {
        grid-template-columns: 1fr;
    }
}

.audit-checklist-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
}

.audit-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    cursor: pointer;
}

.audit-checklist-item:last-child {
    margin-bottom: 0;
}

.audit-checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary, #059669);
    cursor: pointer;
    margin-top: 2px;
}

.audit-checklist-label {
    font-size: 0.875rem;
    color: #334155;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}

.audit-textarea {
    width: 100%;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.85rem;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

.audit-textarea:focus {
    border-color: var(--primary, #059669);
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.audit-quick-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.audit-template-pill {
    font-size: 0.75rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0.25rem 0.65rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audit-template-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ==========================================================================
   PAINEL DA ADMINISTRAÇÃO (admin_audit) ESPECÍFICO
   ========================================================================== */
.admin-audit-kpi-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.admin-kpi-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
    position: relative;
    overflow: hidden;
}

.admin-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
}

.admin-kpi-card.kpi-blue::before   { background: #3b82f6; }
.admin-kpi-card.kpi-red::before    { background: #ef4444; }
.admin-kpi-card.kpi-amber::before  { background: #f59e0b; }
.admin-kpi-card.kpi-emerald::before{ background: #059669; }

.admin-kpi-label {
    font-size: 0.775rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.admin-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.admin-kpi-subtext {
    font-size: 0.8rem;
    color: #64748b;
}

/* Distribution Bars */
.admin-dist-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
}

.admin-dist-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.admin-dist-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.admin-dist-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.admin-dist-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.admin-dist-bar-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.admin-dist-bar-fill {
    height: 100%;
    border-radius: 4px;
}

/* Table of Audits */
.admin-audit-table-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
    overflow: hidden;
    margin-bottom: 2rem;
}

.admin-audit-table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: #fafafa;
}

.admin-audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-audit-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.775rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1.5px solid #e2e8f0;
}

.admin-audit-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.admin-audit-table tr:hover td {
    background: #f8fafc;
}

/* Modals */
.audit-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.audit-modal-backdrop.d-none {
    display: none !important;
}

.audit-modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: auditModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auditModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.audit-modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.audit-modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    flex: 1;
}

.audit-modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
}

/* Toast Notification */
.audit-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    font-size: 0.875rem;
    font-weight: 600;
    border-left: 5px solid var(--primary, #059669);
    animation: toastSlideUp 0.3s ease;
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   PAINEL DE ENTRADA MANUAL DO SUPERVISOR & CÁLCULO DE NÃO-VENDAS
   ========================================================================== */
.audit-manual-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md, 14px);
    padding: 1.5rem 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.04);
}

.audit-manual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.audit-manual-item {
    background: var(--surface-subtle, #f8fafc);
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.audit-manual-item:focus-within {
    border-color: var(--primary, #059669);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.audit-manual-item.no-sale-highlight {
    background: #fff8f8;
    border-color: #fca5a5;
}

.audit-manual-item.no-sale-highlight:focus-within {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.audit-input-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    margin-top: 0.35rem;
}

.audit-input-number:focus {
    outline: none;
}

.audit-no-sale-badge {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.audit-funnel-step.step-no-sale {
    border-top: 4px solid #ef4444;
    background: #fffafa;
}

/* ==========================================================================
   PAINEL EXECUTIVO DE GRÁFICOS: VARIÁVEIS QUALITATIVAS NOMINAIS (DIRETORIA)
   ========================================================================== */
.admin-audit-charts-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md, 14px);
    padding: 1.75rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 6px 25px -4px rgba(0, 0, 0, 0.05);
}

.audit-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1.5px solid #f1f5f9;
}

.audit-chart-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    margin: 0.35rem 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audit-chart-desc {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin: 0;
    max-width: 820px;
    line-height: 1.45;
}

.audit-chart-view-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
    border: 1px solid #e2e8f0;
}

.btn-toggle-view {
    border: none;
    background: transparent;
    padding: 0.55rem 0.95rem;
    font-size: 0.825rem;
    font-weight: 700;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-toggle-view:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.7);
}

.btn-toggle-view.active {
    background: #ffffff;
    color: var(--primary, #059669);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.audit-charts-container-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.audit-charts-container-grid.side-by-side {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 1024px) {
    .audit-charts-container-grid.side-by-side {
        grid-template-columns: 1fr;
    }
}

.audit-chart-box {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.35rem 1.5rem;
    transition: all 0.2s ease;
}

.audit-chart-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Executive Insights 4-Card Grid */
.audit-executive-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.15rem;
}

.audit-insight-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    border-left: 4px solid #cbd5e1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.audit-insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.audit-insight-card.insight-green {
    border-left-color: #059669;
}

.audit-insight-card.insight-red {
    border-left-color: #dc2626;
}

.audit-insight-card.insight-orange {
    border-left-color: #ea580c;
}

.audit-insight-card.insight-amber {
    border-left-color: #d97706;
}

.audit-insight-icon {
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.audit-insight-label {
    font-size: 0.725rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.audit-insight-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0.25rem 0 0.2rem 0;
}

.audit-insight-desc {
    font-size: 0.775rem;
    color: #64748b;
    line-height: 1.35;
}

/* ============================================================= */
/* BOOTSTRAP 5 EXECUTIVE UTILITIES & SUPERVISOR AUDIT UI/UX      */
/* ============================================================= */
.audit-kpi-row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.audit-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.audit-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    border-color: #cbd5e1;
}

.audit-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.65rem;
    gap: 0.5rem;
}

.audit-kpi-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.25;
}

.audit-kpi-icon-pill {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.audit-kpi-val {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.audit-kpi-meta {
    font-size: 0.775rem;
    color: #64748b;
    line-height: 1.35;
}

/* Mixed Field Form (Apuração de Campo) */
.audit-mixed-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.audit-readonly-field {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    transition: all 0.2s ease;
}

.audit-readonly-field:hover {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

.audit-readonly-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
}

/* Bootstrap 5 Fallback Grid & Utilities */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
    margin-top: calc(-1 * var(--bs-gutter-y));
    margin-right: calc(-0.5 * var(--bs-gutter-x));
    margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.g-3 > * {
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}

.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
}

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.33333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.66666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.33333333%; }
}

@media (min-width: 1200px) {
    .col-xl {
        flex: 1 0 0%;
        width: 100%;
    }
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
}

.card-header {
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

.shadow-sm {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05) !important;
}

.border-0 { border: 0 !important; }
.rounded-3 { border-radius: 0.75rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.h-100 { height: 100% !important; }

.text-success { color: #059669 !important; }
.text-danger { color: #dc2626 !important; }
.text-muted { color: #64748b !important; }
.text-primary { color: #2563eb !important; }
.text-dark { color: #0f172a !important; }

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fs-4 { font-size: 1.35rem !important; }
.fs-5 { font-size: 1.15rem !important; }
.fs-6 { font-size: 0.95rem !important; }
.small { font-size: 0.85rem !important; }
.text-uppercase { text-transform: uppercase !important; }

.form-label {
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
}

.form-control, .form-select {
    display: block;
    width: 100%;
    padding: 0.65rem 0.95rem;
    font-size: 0.925rem;
    font-weight: 500;
    line-height: 1.5;
    color: #1e293b;
    background-color: #fff;
    background-clip: padding-box;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    color: #1e293b;
    background-color: #fff;
    border-color: #059669;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(5, 150, 105, 0.15);
}

.form-control-plaintext {
    display: block;
    width: 100%;
    padding: 0.35rem 0;
    margin-bottom: 0;
    line-height: 1.5;
    color: #0f172a;
    background-color: transparent;
    border: solid transparent;
    border-width: 1px 0;
}

.form-control-plaintext:focus {
    outline: 0;
}

.bg-light { background-color: #f8fafc !important; }
.bg-white { background-color: #ffffff !important; }

.bg-success-subtle { background-color: #ecfdf5 !important; }
.bg-danger-subtle { background-color: #fef2f2 !important; }
.bg-primary-subtle { background-color: #eff6ff !important; }
.bg-warning-subtle { background-color: #fffbeb !important; }

.border-success-subtle { border-color: #a7f3d0 !important; }
.border-danger-subtle { border-color: #fecaca !important; }
.border-primary-subtle { border-color: #bfdbfe !important; }

.rounded-pill { border-radius: 50rem !important; }
.border-bottom { border-bottom: 1px solid #e2e8f0 !important; }

/* ==========================================================================
   REFATORAÇÃO DA TELA DE AUDITORIA: SEPARAÇÃO VISUAL (LEITURA vs PREENCHIMENTO)
   ========================================================================== */

/* Seção 1: ERP / Leitura Automática */
.audit-erp-section {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.audit-section-badge-erp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e2e8f0;
    color: #475569;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.775rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Seção 2: Supervisor / Preenchimento Ativo */
.audit-supervisor-workspace {
    background: #ffffff;
    border: 2px solid #059669;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px -5px rgba(5, 150, 105, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: relative;
}

.audit-workspace-header {
    border-bottom: 2px solid #ecfdf5;
    padding-bottom: 1.25rem;
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.audit-workspace-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.audit-step-block {
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1.5px dashed #f1f5f9;
}

.audit-step-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.audit-step-heading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.audit-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #059669;
    color: #ffffff;
    font-size: 0.825rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audit-step-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.audit-step-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 0.85rem 0;
}

/* Perfis compactos e modernos */
.audit-profiles-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.15rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.audit-card-chip {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    letter-spacing: 0.03em;
}
.audit-card-chip.warning { background: #fef3c7; color: #b45309; }
.audit-card-chip.orange  { background: #ffedd5; color: #c2410c; }
.audit-card-chip.purple  { background: #f3e8ff; color: #7e22ce; }
.audit-card-chip.danger  { background: #fee2e2; color: #b91c1c; }
.audit-card-chip.success { background: #dcfce7; color: #15803d; }

.audit-profile-compact-card .audit-profile-badge {
    position: static !important;
    display: none;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.audit-profile-compact-card.selected .audit-profile-badge {
    display: inline-block !important;
}

.audit-profile-badge.badge-tirador   { background: #d97706; color: #fff; }
.audit-profile-badge.badge-gargalo   { background: #ea580c; color: #fff; }
.audit-profile-badge.badge-inseguro  { background: #7c3aed; color: #fff; }
.audit-profile-badge.badge-inimigo   { background: #e11d48; color: #fff; }
.audit-profile-badge.badge-consultor { background: #059669; color: #fff; }

.audit-profile-compact-card.suggested {
    outline: 2px dashed #0284c7;
    outline-offset: 2px;
}

.audit-profile-compact-card.suggested::before {
    display: none !important;
}

.audit-profile-compact-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 185px;
}

.audit-profile-compact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.audit-profile-compact-card.selected {
    border-width: 2.5px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.audit-profile-compact-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.audit-profile-compact-emoji {
    font-size: 1.5rem;
    line-height: 1.1;
    flex-shrink: 0;
}

.audit-profile-compact-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
}

.audit-profile-compact-summary {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    flex-grow: 1;
}

.audit-profile-compact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 0.5rem;
    font-size: 0.75rem;
}

/* Checklist 2 Colunas */
.audit-checklist-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.75rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
}

.audit-checklist-item-modern {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin: 0;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.audit-checklist-item-modern:hover {
    background: #f1f5f9;
}

.audit-checklist-item-modern input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #059669;
    flex-shrink: 0;
    cursor: pointer;
}

.audit-checklist-item-modern span {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.4;
    font-weight: 500;
}




