/* ============================================================================
   MODULO 06/8 - app/06-dashboard-listas.css (ex-app.css linhas 11123-13279). Fix global pesquisa das listagens, dashboard redesign/denso/impacto, bar chart, dark dashboard, utilities. A ORDEM DE INCLUSAO 01->08 E CRITICA - nao reordenar.
   ============================================================================ */
/* =========================================================
   FIX GLOBAL - CAMPO DE PESQUISA DAS LISTAGENS
   Mantém filtros grandes e botões alinhados à direita
========================================================= */

.bm-filter-card {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 18px !important;
    width: 100% !important;
}

.bm-filter-card .filter-group {
    flex: 1 1 auto !important;
    min-width: 420px !important;
    max-width: none !important;
}

.bm-filter-card .filter-group .input-icon {
    width: 100% !important;
    max-width: 760px !important;
}

.bm-filter-card .filter-group .input-icon .ui-inputfield,
.bm-filter-card .filter-group .input-icon input,
.bm-filter-card .filter-group .ui-inputfield,
.bm-filter-card .filter-group input {
    width: 100% !important;
    min-width: 420px !important;
    height: 44px !important;
    box-sizing: border-box !important;
}

.bm-filter-card .list-filter-actions,
.bm-filter-card .filter-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
}

.bm-filter-card .ui-button {
    min-height: 44px !important;
    white-space: nowrap !important;
}

/* Quando houver apenas pesquisa + botões, deixa a pesquisa ocupar bem o espaço */
.bm-filter-card .filter-group:first-child {
    flex-grow: 1 !important;
}

/* Responsivo */
@media (max-width: 900px) {
    .bm-filter-card {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .bm-filter-card .filter-group,
    .bm-filter-card .filter-group .input-icon,
    .bm-filter-card .filter-group .input-icon .ui-inputfield,
    .bm-filter-card .filter-group .input-icon input,
    .bm-filter-card .filter-group .ui-inputfield,
    .bm-filter-card .filter-group input {
        min-width: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .bm-filter-card .list-filter-actions,
    .bm-filter-card .filter-actions {
        width: 100% !important;
        justify-content: flex-end !important;
    }
}

/* === Fase 1: UX Improvements === */

/* Messages com animação */
.ui-messages {
    animation: bm-fadeIn 0.3s ease;
    border-radius: 10px !important;
    border-left: 4px solid !important;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08) !important;
}
.ui-messages-info {
    border-left-color: #2196F3 !important;
    background: #e3f2fd !important;
}
.ui-messages-error {
    border-left-color: #f44336 !important;
    background: #ffebee !important;
}
.ui-messages-warn {
    border-left-color: #ff9800 !important;
    background: #fff3e0 !important;
}
.ui-messages-fatal {
    border-left-color: #d32f2f !important;
    background: #ffcdd2 !important;
}
.ui-messages .ui-messages-info-icon { background: none !important; font: normal normal normal 14px/1 'Font Awesome 5 Free'; }
.ui-messages .ui-messages-info-icon::before { content: "\f05a"; color: #2196F3; font-weight: 900; }
.ui-messages .ui-messages-error-icon::before { content: "\f06a"; color: #f44336; font-weight: 900; }
.ui-messages .ui-messages-warn-icon::before { content: "\f071"; color: #ff9800; font-weight: 900; }

@keyframes bm-fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Toast inline (growl alternativo) */
.bm-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.bm-toast {
    pointer-events: auto;
    padding: 14px 18px;
    border-radius: 10px;
    border-left: 4px solid;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    animation: bm-toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    max-width: 400px;
}
.bm-toast-info    { background: #e3f2fd; border-color: #2196F3; color: #0d47a1; }
.bm-toast-error   { background: #ffebee; border-color: #f44336; color: #b71c1c; }
.bm-toast-warn    { background: #fff3e0; border-color: #ff9800; color: #e65100; }
@keyframes bm-toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Empty state */
.bm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--bm-muted);
}
.bm-empty-state i {
    font-size: 56px;
    margin-bottom: 16px;
    color: #cbd5e1;
}
.bm-empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--bm-text);
}
.bm-empty-state p {
    margin: 0 0 20px;
    font-size: 14px;
    max-width: 360px;
}
.bm-empty-state .bm-empty-btn,
.bm-empty-state .bm-btn {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: var(--bm-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.bm-empty-state .bm-btn:hover {
    background: var(--bm-primary-dark);
}

/* Badges de alerta no form contrato */
.bm-alert-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.bm-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.bm-alert-badge.badge-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}
.bm-alert-badge.badge-info {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
}
.bm-alert-badge.badge-success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}
.bm-alert-badge.badge-danger {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ffcdd2;
}

/* Tooltips customizados */
.bm-field-hint {
    font-size: 11px;
    color: var(--bm-muted);
    margin-top: 2px;
}
label[title] {
    cursor: help;
    border-bottom: 1px dashed var(--bm-muted);
}

/* Atalhos recentes na sidebar */
.sidebar-recentes {
    padding: 0 12px 12px;
    border-bottom: 1px solid var(--bm-border);
    margin-bottom: 12px;
}
.sidebar-recentes-titulo {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bm-muted);
    padding: 8px 4px 6px;
}
.sidebar-recentes-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    color: var(--bm-text) !important;
    text-decoration: none !important;
    transition: background 0.15s;
}
.sidebar-recentes-link:hover {
    background: var(--bm-primary-light) !important;
    color: var(--bm-primary) !important;
}
.sidebar-recentes-link i {
    font-size: 12px;
    color: var(--bm-muted);
}
.sidebar-collapsed .sidebar-recentes { display: none !important; }

/* Timeline financeiro */
.bm-timeline {
    position: relative;
    padding: 0;
    margin: 16px 0 0;
    list-style: none;
}
.bm-timeline::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 16px;
    width: 2px;
    height: calc(100% - 16px);
    background: var(--bm-border);
}
.bm-timeline-item {
    position: relative;
    padding: 0 0 20px 44px;
}
.bm-timeline-item:last-child {
    padding-bottom: 0;
}
.bm-timeline-dot {
    position: absolute;
    left: 9px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--bm-border);
    background: #fff;
    z-index: 1;
}
.bm-timeline-dot.dot-success {
    border-color: var(--bm-success, #22c55e);
    background: #dcfce7;
}
.bm-timeline-dot.dot-warning {
    border-color: var(--bm-warning, #f59e0b);
    background: #fef3c7;
}
.bm-timeline-dot.dot-danger {
    border-color: var(--bm-danger, #ef4444);
    background: #fee2e2;
}
.bm-timeline-dot.dot-info {
    border-color: var(--bm-info, #3b82f6);
    background: #dbeafe;
}
.bm-timeline-dot i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: inherit;
}
.bm-timeline-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--bm-border);
    transition: background 0.15s;
}
.bm-timeline-content:hover {
    background: #f1f5f9;
}
.bm-timeline-date {
    min-width: 90px;
    font-size: 12px;
    color: var(--bm-muted);
    white-space: nowrap;
}
.bm-timeline-date strong {
    display: block;
    font-size: 14px;
    color: var(--bm-text);
}
.bm-timeline-body {
    flex: 1;
    min-width: 0;
}
.bm-timeline-body .t-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--bm-text);
}
.bm-timeline-body .t-sub {
    font-size: 12px;
    color: var(--bm-muted);
    margin-top: 2px;
}
.bm-timeline-amount {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--bm-text);
}
.bm-timeline-amount.amount-income {
    color: var(--bm-success, #22c55e);
}
.bm-timeline-amount.amount-expense {
    color: var(--bm-danger, #ef4444);
}

/* Receita x Despesa chart */
.bm-bar.income {
    background: linear-gradient(to top, #22c55e, #16a34a);
}
.bm-bar.expense {
    background: linear-gradient(to top, #ef4444, #dc2626);
}
.bm-bar-value.income-value {
    color: var(--bm-success, #22c55e);
}
.bm-bar-value.expense-value {
    color: var(--bm-danger, #ef4444);
}

/* Notificações */
.bm-notif-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.bm-notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--bm-danger, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
    z-index: 2;
}
.bm-notif-panel.ui-overlaypanel {
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid var(--bm-border);
    padding: 0;
}
.bm-notif-panel .ui-overlaypanel-content {
    padding: 0;
}
.bm-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bm-border);
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}
.bm-notif-header strong {
    font-size: 14px;
    color: var(--bm-text);
}
.bm-notif-mark-all {
    font-size: 12px;
    color: var(--bm-primary);
    cursor: pointer;
}
.bm-notif-mark-all:hover {
    text-decoration: underline;
}
.bm-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--bm-muted);
}
.bm-notif-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--bm-success, #22c55e);
}
.bm-notif-empty p {
    font-size: 13px;
    margin: 0;
}
.bm-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bm-border);
    cursor: pointer;
    transition: background 0.12s;
}
.bm-notif-item:hover {
    background: #f1f5f9;
}
.bm-notif-item:last-child {
    border-bottom: none;
}
.bm-notif-item-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: var(--bm-primary);
    margin-top: 5px;
}
.bm-notif-item-body {
    flex: 1;
    min-width: 0;
}
.bm-notif-item-text {
    font-size: 13px;
    color: var(--bm-text);
    line-height: 1.35;
}
.bm-notif-item-date {
    font-size: 11px;
    color: var(--bm-muted);
    margin-top: 2px;
}
.bm-notif-item-dismiss {
    color: var(--bm-muted);
    font-size: 13px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.12s;
    opacity: 0.5;
    text-decoration: none !important;
}
.bm-notif-item:hover .bm-notif-item-dismiss {
    opacity: 1;
}
.bm-notif-item-dismiss:hover {
    color: var(--bm-success, #22c55e);
    background: #dcfce7;
}

/* Upload documentos */
.bm-documentos-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.table-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--bm-muted);
    text-decoration: none !important;
    transition: all 0.12s;
}
.table-action-link:hover {
    background: var(--bm-primary-light);
    color: var(--bm-primary);
}
.table-action-danger:hover {
    background: #fee2e2;
    color: var(--bm-danger, #ef4444);
}

/* Onboarding */
.onboarding-shell {
    max-width: 640px;
    margin: 60px auto;
    padding: 0 20px;
}
.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 40px;
}
.onboarding-step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.onboarding-step.active {
    opacity: 1;
}
.onboarding-step .step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bm-border);
    color: var(--bm-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}
.onboarding-step.active .step-num {
    background: var(--bm-primary);
    color: #fff;
}
.onboarding-step .step-label {
    font-size: 14px;
    color: var(--bm-text);
}
.onboarding-card {
    background: var(--bm-card-bg);
    border: 1px solid var(--bm-border);
    border-radius: 12px;
    padding: 36px;
}
.onboarding-card h1, .onboarding-card h2 {
    margin: 0 0 12px;
    color: var(--bm-heading);
}
.onboarding-card p {
    color: var(--bm-muted);
    line-height: 1.6;
    margin: 0 0 8px;
}
.btn-link {
    background: none;
    border: none;
    color: var(--bm-primary);
    cursor: pointer;
    font-size: 14px;
    padding: 6px 12px;
    text-decoration: underline;
}
.btn-link:hover {
    color: var(--bm-primary-dark, #2563eb);
}
.sidebar-plan-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin: 0 12px 10px;
    background: var(--bm-primary-light, #e0e7ff);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.sidebar-plan-widget:hover {
    background: var(--bm-primary-lighter, #c7d2fe);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.plan-widget-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bm-primary, #4f46e5);
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    flex-shrink: 0;
}
.plan-widget-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.plan-widget-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--bm-primary, #4f46e5);
    line-height: 1.2;
}
.plan-widget-usage {
    font-size: 10px;
    color: var(--bm-primary-dim, #6366f1);
    line-height: 1.3;
}
.sidebar-collapsed .sidebar-plan-widget {
    padding: 8px;
    justify-content: center;
}
.sidebar-collapsed .plan-widget-info {
    display: none;
}

/* --- Dialog de comparação de planos --- */
.plan-dialog-body {
    padding: 4px 0;
}
.plan-current-card {
    background: var(--bm-surface, #f8fafc);
    border: 1px solid var(--bm-border, #e2e8f0);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.plan-current-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.plan-current-icon {
    font-size: 22px;
    color: var(--bm-primary, #4f46e5);
}
.plan-current-label {
    display: block;
    font-size: 11px;
    color: var(--bm-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plan-current-name {
    font-size: 18px;
    color: var(--bm-text, #1e293b);
}
.plan-current-trial {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.trial-active {
    background: #fef3c7;
    color: #92400e;
}
.trial-expired {
    background: #fee2e2;
    color: #991b1b;
}

/* Barras de uso */
.plan-usage-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.usage-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.usage-bar-label {
    width: 80px;
    font-size: 12px;
    color: var(--bm-muted, #64748b);
    flex-shrink: 0;
}
.usage-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bm-border, #e2e8f0);
    border-radius: 4px;
    overflow: hidden;
}
.usage-bar-fill {
    height: 100%;
    background: var(--bm-primary, #4f46e5);
    border-radius: 4px;
    transition: width 0.3s;
}
.usage-bar-value {
    width: 70px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--bm-text, #1e293b);
    flex-shrink: 0;
}

/* Recursos do plano atual */
.plan-features-current {
    margin-bottom: 20px;
}
.plan-features-current h4,
.plan-comparison-table-wrap h4 {
    font-size: 13px;
    color: var(--bm-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}
.plan-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 16px;
}
.plan-feature-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
}
.feature-yes {
    background: #dcfce7;
    color: #166534;
}
.feature-no {
    background: #f1f5f9;
    color: #94a3b8;
}
.feature-yes .pi { color: #16a34a; font-size: 12px; }
.feature-no .pi { color: #94a3b8; font-size: 12px; }

/* Tabela comparativa */
.plan-comparison-table-wrap {
    overflow-x: auto;
}
.plan-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.plan-comparison-table th,
.plan-comparison-table td {
    padding: 8px 14px;
    text-align: center;
    border-bottom: 1px solid var(--bm-border, #e2e8f0);
}
.plan-comparison-table th {
    font-weight: 700;
    color: var(--bm-text, #1e293b);
    background: var(--bm-surface, #f8fafc);
    white-space: nowrap;
}
.plan-comparison-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--bm-muted, #64748b);
    background: var(--bm-surface, #fafafa);
    white-space: nowrap;
}
.plan-comparison-table .pi-check.green { color: #16a34a; }
.plan-comparison-table .pi-times.gray { color: #94a3b8; }

.plan-upgrade-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.plan-upgrade-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #475569;
}
.plan-upgrade-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.plan-upgrade-select {
    flex: 1;
    min-width: 200px;
}

.plano-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 1100px) { /* breakpoint canônico: era 1000px */
    .plano-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .plano-kpi-grid { grid-template-columns: 1fr; }
}

.plano-distrib-card {
    background: #fff;
    border: 1px solid var(--bm-border, #e7eaf3);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(22,32,79,.06);
    margin-bottom: 18px;
    overflow: hidden;
}
.plano-distrib-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bm-border, #e7eaf3);
    font-weight: 800;
    font-size: 14px;
    color: #16204f;
}
.plano-distrib-header i {
    font-size: 16px;
    color: #4f6ef7;
}
.plano-distrib-body {
    padding: 16px 20px;
}
.plano-distrib-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}
.plano-distrib-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    min-width: 130px;
}
.plano-distrib-track {
    flex: 1;
    height: 12px;
    background: #eef2f7;
    border-radius: 6px;
    overflow: hidden;
}
.plano-distrib-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f6ef7, #6b8aff);
    border-radius: 6px;
    transition: width .4s ease;
}
.plano-distrib-count {
    font-size: 14px;
    font-weight: 800;
    color: #16204f;
    min-width: 30px;
    text-align: right;
}
.plano-distrib-empty {
    padding: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--bm-muted);
    font-size: 13px;
}
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--bm-border);
}

/* Login benefits list */
.login-benefits {
    list-style: none;
    padding: 0;
    margin: 18px 0;
}
.login-benefits li {
    padding: 6px 0;
    color: var(--bm-text-muted, #64748b);
}
.login-benefits li::before {
    content: "✓ ";
    color: var(--bm-primary);
    font-weight: 700;
}
.login-footer-text {
    margin-top: 24px;
    font-size: 14px;
    color: var(--bm-muted);
}
.login-footer-text a {
    color: var(--bm-primary);
    text-decoration: none;
    font-weight: 500;
}
.login-footer-text a:hover {
    text-decoration: underline;
}

.login-version {
    margin-top: 16px;
    text-align: center;
    font-size: 11px;
    color: var(--bm-muted);
    letter-spacing: 0.5px;
    opacity: 0.5;
}

.login-loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.login-loader p {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

.login-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 0.7s linear infinite;
}

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

@media (max-width: 768px) {
    .login-loader {
        backdrop-filter: none;
    }
}

/* =========================
   DASHBOARD REDESIGN
   ========================= */
.dash-trial-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 14px;
    margin-bottom: 20px;
}
.dash-trial-bar i { font-size: 16px; color: #d97706; }

.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 24px;
    margin-bottom: 22px;
    color: #fff;
}
.dash-hero-left { flex: 1; }
.dash-hero-greeting {
    font-size: 16px;
    color: rgba(255,255,255,.7);
    margin-bottom: 4px;
}
.dash-hero-greeting strong { color: #fff; }
.dash-hero-title {
    margin: 4px 0 12px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.dash-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.dash-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255,255,255,.85);
}
.dash-hero-badge i { font-size: 12px; }
.dash-hero-badge-warning {
    background: rgba(251,191,36,.15);
    border-color: rgba(251,191,36,.3);
    color: #fbbf24;
}

.dash-health-ring {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}
.dash-health-ring svg { width: 100%; height: 100%; }
.dash-health-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.dash-health-value strong {
    font-size: 24px;
    color: #fff;
    line-height: 1;
}
.dash-health-value span {
    font-size: 11px;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
@media (max-width: 1100px) {
    .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .dash-kpi-grid { grid-template-columns: 1fr; }
}
.dash-kpi-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e7eaf3;
    border-left-width: 4px;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: 0 4px 20px rgba(22,32,79,.05);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.dash-kpi-card:hover {
    box-shadow: 0 8px 30px rgba(22,32,79,.1);
    transform: translateY(-2px);
}
.dash-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.dash-kpi-body { flex: 1; }
.dash-kpi-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 2px;
}
.dash-kpi-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #16204f;
    line-height: 1.1;
    margin-bottom: 2px;
}
.dash-kpi-sub {
    font-size: 12px;
    color: #94a3b8;
}

/* Onboarding checklist */
.dash-onboarding {
    background: #fff;
    border: 1px solid #e7eaf3;
    border-radius: 20px;
    margin-bottom: 22px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(22,32,79,.04);
}
.dash-onboarding-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px;
    background: #f8fafc;
    border-bottom: 1px solid #e7eaf3;
    font-weight: 700;
    font-size: 15px;
    color: #16204f;
}
.dash-onboarding-header i { color: #4f6ef7; font-size: 18px; }
.dash-onboarding-progress {
    margin-left: auto;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}
.dash-onboarding-list { padding: 6px 0; }
.dash-onboarding-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.dash-onboarding-item:last-child { border-bottom: none; }
.dash-onboarding-item.done { opacity: .65; }
.dash-onboarding-check i {
    font-size: 22px;
    color: #cbd5e1;
}
.dash-onboarding-item.done .dash-onboarding-check i { color: #16a34a; }
.dash-onboarding-info { flex: 1; }
.dash-onboarding-info strong {
    display: block;
    font-size: 14px;
    color: #16204f;
}
.dash-onboarding-info span {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-top: 1px;
}
.dash-onboarding-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4f6ef7;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.dash-onboarding-btn:hover { background: #dbe3ff; }
.dash-onboarding-btn i { font-size: 11px; }

/* Bottom grid */
.dash-bottom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {
    .dash-bottom-grid { grid-template-columns: 1fr; }
}

.dash-panel {
    background: #fff;
    border: 1px solid #e7eaf3;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(22,32,79,.04);
}
.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
}
.dash-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #16204f;
}
.dash-panel-header p {
    margin: 2px 0 0;
    font-size: 13px;
    color: #64748b;
}
.dash-panel-header i {
    font-size: 22px;
    color: #4f6ef7;
    opacity: .6;
}
.dash-panel-body { padding: 8px 0; }

.dash-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 22px;
    border-bottom: 1px solid #f8fafc;
}
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-icon i {
    font-size: 14px;
    color: #4f6ef7;
    margin-top: 2px;
}
.dash-activity-content { flex: 1; }
.dash-activity-text {
    display: block;
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
}
.dash-activity-time {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}
.dash-empty {
    padding: 24px 22px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.dash-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 22px;
}
.dash-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e7eaf3;
    text-decoration: none;
    color: #16204f;
    font-weight: 700;
    font-size: 13px;
    transition: background .15s, box-shadow .15s;
}
.dash-action:hover {
    background: #eef2ff;
    box-shadow: 0 4px 14px rgba(79,110,247,.1);
}
.dash-action i {
    font-size: 16px;
    color: #4f6ef7;
}

.dash-alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    color: #334155;
    font-size: 13px;
    border-bottom: 1px solid #f8fafc;
}
.dash-alert-item:last-child { border-bottom: none; }
.dash-alert-item i {
    color: #ea580c;
    font-size: 14px;
    flex-shrink: 0;
}
.dash-alerta-critico i { color: #dc2626; }
.dash-alerta-aviso i { color: #d97706; }
.dash-alerta-info i { color: #4f6ef7; }
.dash-alerta-sucesso i { color: #16a34a; }

/* dash hero date */
.dash-hero-data {
    display: inline;
    font-weight: 400;
    font-size: 13px;
    color: rgba(255,255,255,.55);
    margin-left: 8px;
}

/* dash health ring animation */
.dash-health-anim .dash-health-arc {
    stroke-dasharray: 264;
    animation: dash-health-fill 1.2s ease-out forwards;
}
@keyframes dash-health-fill {
    from { stroke-dashoffset: 264; }
}

/* dash kpi link wrapper — flex p/ o card preencher a célula do grid (senão desalinha na linha) */
.dash-kpi-link {
    display: flex;
    text-decoration: none;
    color: inherit;
}
.dash-kpi-link .dash-kpi-card {
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: box-shadow .2s, transform .15s;
}
.dash-kpi-link .dash-kpi-card:hover {
    box-shadow: 0 8px 28px rgba(22,32,79,.1);
    transform: translateY(-2px);
}
.dash-kpi-link .dash-kpi-card:active {
    transform: translateY(0);
}

/* dash strip "Sua Operação" */
.dash-strip {
    background: #fff;
    border: 1px solid #e7eaf3;
    border-radius: 20px;
    margin-bottom: 22px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(22,32,79,.04);
}
.dash-strip-header {
    padding: 16px 22px 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
}
.dash-strip-items {
    display: flex;
    gap: 0;
    padding: 8px 16px 16px;
    flex-wrap: wrap;
}
.dash-strip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    min-width: 160px;
    flex: 1;
}
.dash-strip-item i {
    font-size: 20px;
    color: #4f6ef7;
    opacity: .7;
    flex-shrink: 0;
}
.dash-strip-item strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #16204f;
    line-height: 1.2;
}
.dash-strip-item span {
    display: block;
    font-size: 12px;
    color: #64748b;
}

/* dash surpresa */
.dash-surpresa {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef2ff, #f0fdf4);
    border: 1px solid #c7d2fe;
    color: #4338ca;
    font-size: 13px;
    margin-bottom: 20px;
}
.dash-surpresa i {
    font-size: 16px;
    color: #4f6ef7;
    flex-shrink: 0;
}

/* dash ações section */
.dash-actions-section {
    margin-bottom: 22px;
}
.dash-actions-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: #16204f;
    margin-bottom: 12px;
}
.dash-actions-section-title i {
    font-size: 18px;
    color: #4f6ef7;
}
.dash-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.dash-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e7eaf3;
    box-shadow: 0 4px 16px rgba(22,32,79,.04);
    text-decoration: none;
    color: #334155;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: box-shadow .2s, transform .15s;
}
.dash-action-card:hover {
    box-shadow: 0 8px 24px rgba(22,32,79,.1);
    transform: translateY(-1px);
}
.dash-action-card.critico {
    border-left: 4px solid #dc2626;
}
.dash-action-card.atencao {
    border-left: 4px solid #d97706;
}
.dash-action-card.info {
    border-left: 4px solid #4f6ef7;
}
.dash-action-card.sucesso {
    border-left: 4px solid #16a34a;
}
.dash-action-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.dash-action-card.critico .dash-action-card-icon {
    background: #fef2f2;
    color: #dc2626;
}
.dash-action-card.atencao .dash-action-card-icon {
    background: #fffbeb;
    color: #d97706;
}
.dash-action-card.info .dash-action-card-icon {
    background: #eef2ff;
    color: #4f6ef7;
}
.dash-action-card.sucesso .dash-action-card-icon {
    background: #f0fdf4;
    color: #16a34a;
}
.dash-action-card-text {
    flex: 1;
}
.dash-action-card-arrow {
    font-size: 12px;
    color: #94a3b8;
    flex-shrink: 0;
}

/* dash confete */
.dash-confete {
    margin-bottom: 16px;
}
.dash-confete-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fef9c3, #fef3c7);
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 14px;
    font-weight: 600;
    animation: dash-confete-pulse 2s ease-in-out infinite;
}
.dash-confete-inner i {
    font-size: 22px;
}
@keyframes dash-confete-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* dash charts grid */
.dash-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
@media (max-width: 1100px) {
    .dash-charts-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) { /* breakpoint canônico: era 700px */
    .dash-charts-grid { grid-template-columns: 1fr; }
}
.dash-chart-body {
    padding: 12px 16px 16px;
}

/* dash timeline grouped */
.dash-timeline-grupo {
    border-bottom: 1px solid #f1f5f9;
}
.dash-timeline-grupo:last-child {
    border-bottom: none;
}
.dash-timeline-rotulo {
    padding: 12px 22px 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
}
.dash-timeline-grupo .dash-activity-item {
    padding: 10px 22px 10px 22px;
}

/* responsividade: strip empilhar em mobile */
@media (max-width: 768px) { /* breakpoint canônico: era 700px */
    .dash-strip-items {
        flex-direction: column;
    }
    .dash-strip-item {
        padding: 8px 18px;
    }
}

/* responsividade: action cards 1 coluna em mobile */
@media (max-width: 768px) { /* breakpoint canônico: era 700px */
    .dash-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* responsividade: bottom grid 1 coluna mais cedo */
@media (max-width: 768px) { /* breakpoint canônico: era 700px */
    .dash-bottom-grid {
        grid-template-columns: 1fr;
    }
}

/* responsividade: hero empilhar em mobile */
@media (max-width: 640px) {
    .dash-hero {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 22px;
    }
    .dash-hero-meta {
        justify-content: center;
    }
    .dash-hero-data {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}

/* =========================
   BAR CHART (shared)
   ========================= */
.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.bar-label {
    width: 120px;
    font-size: 12px;
    font-weight: 700;
    color: var(--bm-text, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-track {
    flex: 1;
    height: 22px;
    background: var(--bm-surface-strong, #f1f5f9);
    border-radius: 999px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--bm-accent, #3b82f6);
    transition: width .3s ease;
}
.bar-count {
    width: 40px;
    text-align: right;
    font-size: 12px;
    font-weight: 800;
    color: var(--bm-text, #0f172a);
}

/* =========================
   DARK MODE - DASHBOARD
   ========================= */
.theme-dark .dash-kpi-card,
.theme-dark .dash-panel,
.theme-dark .dash-onboarding,
.theme-dark .dash-strip,
.theme-dark .dash-actions-section,
.theme-dark .dash-charts-grid .dash-panel,
.theme-dark .dash-timeline-grupo {
    background: #0f172a;
    border-color: #1e293b;
}
.theme-dark .dash-kpi-card {
    background: linear-gradient(135deg, #0f172a 0%, #131c31 100%);
    border-left-color: inherit;
}
.theme-dark .dash-kpi-value { color: #f8fafc; }
.theme-dark .dash-kpi-sub { color: #94a3b8; }
.theme-dark .dash-onboarding-header { background: #111827; border-color: #1e293b; }
.theme-dark .dash-onboarding-header strong { color: #f8fafc; }
.theme-dark .dash-onboarding-item { border-color: #1e293b; }
.theme-dark .dash-onboarding-info strong { color: #f8fafc; }
.theme-dark .dash-onboarding-info span { color: #94a3b8; }
.theme-dark .dash-panel-header { border-color: #1e293b; }
.theme-dark .dash-panel-header h3 { color: #f8fafc; }
.theme-dark .dash-panel-header p { color: #94a3b8; }
.theme-dark .dash-panel-header i { color: #4650D4; }
.theme-dark .dash-activity-item { border-color: #1e293b; }
.theme-dark .dash-activity-text { color: #f8fafc; }
.theme-dark .dash-activity-time { color: #94a3b8; }
.theme-dark .dash-action { background: #162033; border-color: #1e293b; color: #f8fafc; }
.theme-dark .dash-action i { color: #4650D4; }
.theme-dark .dash-alert-item { border-color: #1e293b; color: #f8fafc; }
.theme-dark .dash-empty { color: #94a3b8; }
.theme-dark .dash-strip-header { border-color: #1e293b; }
.theme-dark .dash-strip-item { border-color: #1e293b; }
.theme-dark .dash-confete { background: transparent; }
.theme-dark .dash-charts-grid .dash-panel .dash-panel-body canvas { filter: brightness(.85); }
.theme-dark .dash-surpresa { background: #0f172a; border-color: #1e293b; }
.theme-dark .dash-action-card { background: #0f172a; border-color: #1e293b; }
.theme-dark .dash-action-card-text { color: #f8fafc; }

/* Dark - Ticket Dashboard */
.theme-dark .dash-hero-dticket { background: #0f172a !important; border-color: #1e293b !important; }
.theme-dark .td-kpi-card { background: #0f172a !important; border-color: #1e293b !important; }
.theme-dark .td-kpi-card strong { color: #f8fafc; }
.theme-dark .td-kpi-sub { color: #94a3b8; }
.theme-dark .td-chart-card { background: #0f172a !important; border-color: #1e293b !important; }
.theme-dark .bar-track { background: #162033; }
.theme-dark .bar-label { color: #f8fafc; }
.theme-dark .bar-count { color: #f8fafc; }
.theme-dark .td-sla-section { background: #0f172a !important; border-color: #1e293b !important; }
.theme-dark .td-filter-bar { background: #0f172a !important; border-color: #1e293b !important; }

/* Dark - Contract Cockpit */
.theme-dark .cockpit-contratos,
.theme-dark .cockpit-contratos .bm-macro-card,
.theme-dark .cockpit-contratos .bm-kpi-card,
.theme-dark .cockpit-contratos .bm-analytics-card,
.theme-dark .cockpit-contratos .bm-chart-card,
.theme-dark .cockpit-contratos .bm-health-card,
.theme-dark .cockpit-contratos .bm-contrato-filter-card {
    background: #0f172a !important;
    border-color: #1e293b !important;
}
.theme-dark .cockpit-contratos .bm-priority-card,
.theme-dark .cockpit-contratos .bm-priority-content,
.theme-dark .cockpit-contratos .bm-actions-panel,
.theme-dark .cockpit-contratos .bm-obligation-grid,
.theme-dark .cockpit-contratos .bm-obligation-item,
.theme-dark .cockpit-contratos .bm-funnel-grid,
.theme-dark .cockpit-contratos .bm-funnel-item,
.theme-dark .cockpit-contratos .bm-risk-grid,
.theme-dark .cockpit-contratos .bm-leak-list,
.theme-dark .cockpit-contratos .bm-leak-line,
.theme-dark .cockpit-contratos .bm-actions-cards,
.theme-dark .cockpit-contratos .bm-recommended-card,
.theme-dark .cockpit-contratos .bm-filter-search-row,
.theme-dark .cockpit-contratos .bm-filter-grid-line,
.theme-dark .cockpit-contratos .premium-table-card,
.theme-dark .cockpit-contratos .bm-table-header,
.theme-dark .cockpit-contratos .bm-datatable {
    background: #0f172a !important;
    border-color: #1e293b !important;
}
.theme-dark .cockpit-contratos .bm-filter-premium { background: #0f172a !important; border-color: #1e293b !important; }
.theme-dark .cockpit-contratos .bm-section-title { color: #f8fafc !important; }
.theme-dark .cockpit-contratos .bm-section-title i { color: #64748b !important; }
.theme-dark .cockpit-contratos .bm-filter-title-block { color: #94a3b8 !important; }

/* Dark - PMO Cockpit */
.theme-dark .pmo-card { background: #0f172a; border-color: #1e293b; }
.theme-dark .pmo-card-header { border-color: #1e293b; color: #94a3b8; }
.theme-dark .pmo-macro-card { background: #0f172a; border-color: #1e293b; }
.theme-dark .pmo-macro-value { color: #f8fafc; }
.theme-dark .pmo-macro-sub { color: #64748b; }
.theme-dark .pmo-kpi-card { background: #0f172a; border-color: #1e293b; }
.theme-dark .pmo-kpi-value { color: #f8fafc; }
.theme-dark .pmo-kpi-sub { color: #64748b; }
.theme-dark .pmo-bar-track { background: #162033; }
.theme-dark .pmo-bar-label { color: #f8fafc; }
.theme-dark .pmo-bar-count { color: #94a3b8; }
.theme-dark .pmo-gantt-pista { background: #162033; }
.theme-dark .pmo-gantt-nome { color: #f8fafc; }
.theme-dark .pmo-gantt-gerente { color: #94a3b8; }
.theme-dark .pmo-filter-card { background: #0f172a; border-color: #1e293b; }
.theme-dark .pmo-radar-item { border-color: #1e293b; }
.theme-dark .pmo-action-item { background: #162033; color: #f8fafc; }
.theme-dark .pmo-empty { color: #64748b; }
.theme-dark .ui-chart { background: #0f172a !important; }
.theme-dark .ui-chart canvas { background: transparent !important; }
.theme-dark .wip-badge { background: #4650D4 !important; color: #fff !important; }

/* =========================
   UTILITIES — Fase 1
   Column widths for dataTable
========================= */
.col-w-60  { width: 60px  !important; text-align: center !important; }
.col-w-80  { width: 80px  !important; text-align: center !important; }
.col-w-90  { width: 90px  !important; text-align: center !important; }
.col-w-100 { width: 100px !important; text-align: center !important; }
.col-w-110 { width: 110px !important; text-align: center !important; }
.col-w-120 { width: 120px !important; text-align: center !important; }
.col-w-130 { width: 130px !important; text-align: center !important; }
.col-w-140 { width: 140px !important; text-align: center !important; }
.col-w-150 { width: 150px !important; text-align: center !important; }
.col-w-160 { width: 160px !important; text-align: center !important; }
.col-w-170 { width: 170px !important; text-align: center !important; }
.col-w-180 { width: 180px !important; }
.col-w-190 { width: 190px !important; }
.col-w-200 { width: 200px !important; }
.col-w-210 { width: 210px !important; }

/* ===== KPIs e mini-gráfico de dashboard (globais — usados por Aprovações e outros painéis) ===== */
.bm-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1100px) { .bm-kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { /* breakpoint canônico: era 560px */ .bm-kpi-grid { grid-template-columns: 1fr; } }
.bm-kpi { background: var(--bm-surface, #fff); border: 1px solid var(--bm-border, #dbe4f0); border-radius: 14px; padding: 16px 18px; }
.bm-kpi .v { font-size: 24px; font-weight: 800; line-height: 1.1; }
.bm-kpi .l { font-size: 12px; color: var(--bm-muted, #64748b); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
/* Variante compacta de 5 cards numa linha só */
.bm-kpi-grid.bm-kpi-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bm-kpi-grid.bm-kpi-5 .bm-kpi { padding: 12px 14px; }
.bm-kpi-grid.bm-kpi-5 .bm-kpi .v { font-size: 20px; }
.bm-kpi-grid.bm-kpi-5 .bm-kpi .l { font-size: 11.5px; }
@media (max-width: 1200px) { .bm-kpi-grid.bm-kpi-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .bm-kpi-grid.bm-kpi-5 { grid-template-columns: 1fr 1fr; } }
.bm-trend { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding: 6px 2px; }
.bm-trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bm-trend .bar { width: 60%; border-radius: 5px 5px 0 0; min-height: 2px; }
.bm-trend .lbl { font-size: 10px; color: #94a3b8; }
.col-w-220 { width: 220px !important; }
.col-w-250 { width: 250px !important; }
.col-w-300 { width: 300px !important; }

/* Field label */
.bm-field-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--bm-text);
	margin-bottom: 4px;
}

/* Chart height utilities */
.chart-sm { height: 200px !important; }
.chart-md { height: 260px !important; }
.chart-lg { height: 350px !important; }

/* Spacing utilities */
.mb-sm { margin-bottom: 14px !important; }
.mb-md { margin-bottom: 16px !important; }
.mb-lg { margin-bottom: 24px !important; }
.mt-sm { margin-top: 14px !important; }
.mt-md { margin-top: 16px !important; }
.mt-lg { margin-top: 24px !important; }

/* Dash KPI color variants */
.dash-kpi-card-blue   { border-left-color: #4f46e5 !important; }
.dash-kpi-card-green  { border-left-color: #16a34a !important; }
.dash-kpi-card-amber  { border-left-color: #d97706 !important; }
.dash-kpi-card-rose   { border-left-color: #dc2626 !important; }
.dash-kpi-card-pink   { border-left-color: #db2777 !important; }
.dash-kpi-card-violet { border-left-color: #7c3aed !important; }
.dash-kpi-card-cyan   { border-left-color: #06b6d4 !important; }

.dash-kpi-icon-blue   { background: #eef2ff !important; color: #4f46e5 !important; }
.dash-kpi-icon-green  { background: #ecfdf5 !important; color: #16a34a !important; }
.dash-kpi-icon-amber  { background: #fffbeb !important; color: #d97706 !important; }
.dash-kpi-icon-rose   { background: #fef2f2 !important; color: #dc2626 !important; }
.dash-kpi-icon-pink   { background: #fdf2f8 !important; color: #db2777 !important; }
.dash-kpi-icon-violet { background: #f5f3ff !important; color: #7c3aed !important; }
.dash-kpi-icon-cyan   { background: #ecfeff !important; color: #06b6d4 !important; }

/* Trend icon for dashboard KPI sub-text */
.dash-trend-icon { font-size:10px !important; margin-right:3px !important; }

/* Star icon — color amber */
.pi-star-amber { color: #f59e0b !important; }

/* Body padding variants */
.dash-pad-body-sm { padding: 12px 20px !important; }
.dash-panel-body-nopad { padding: 0 !important; }

/* =========================================================
   DASHBOARD — MODO DENSO (data-rich / cockpit power-user)
   Camada de densidade: sobrescreve SÓ medidas visuais das classes
   .dash-* acima (espaçamento, raios, colunas, tamanhos de fonte).
   Não altera markup nem dados. Para reverter o modo denso,
   basta remover este bloco inteiro.
========================================================= */

/* Ritmo vertical geral: menos respiro entre as seções */
.dash-hero,
.dash-kpi-grid,
.dash-strip,
.dash-onboarding,
.dash-charts-grid,
.dash-actions-section { margin-bottom: 14px; }

/* Hero: de bloco grande para barra compacta */
.dash-hero { padding: 16px 22px; border-radius: 14px; }
.dash-hero-greeting { font-size: 13px; margin-bottom: 2px; }
.dash-hero-title { font-size: 19px; margin: 2px 0 8px; letter-spacing: -.01em; }
.dash-hero-badge { padding: 4px 10px; font-size: 12px; }
.dash-health-ring { width: 64px; height: 64px; }
.dash-health-value strong { font-size: 16px; }
.dash-health-value span { font-size: 9px; }

/* KPIs: todos numa linha em telas largas (6 colunas), respiro reduzido */
.dash-kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }  /* 8 cards = 4+4 equilibrado */
.dash-kpi-card { padding: 12px 14px; border-radius: 12px; gap: 10px; }
.dash-kpi-icon { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; }
.dash-kpi-label { font-size: 10.5px; letter-spacing: .02em; }
.dash-kpi-value { font-size: 22px; }
.dash-kpi-sub { font-size: 11px; }

/* Strip "sua operação": mais enxuta */
.dash-strip { border-radius: 12px; }

/* Painéis e grids mais juntos */
.dash-panel { border-radius: 12px; }
.dash-charts-grid { gap: 12px; }
.dash-bottom-grid { gap: 12px; }
.dash-onboarding { border-radius: 12px; }

/* Responsivo do modo denso (escalona as colunas dos KPIs) */
@media (max-width: 1500px) { .dash-kpi-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .dash-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .dash-kpi-grid { grid-template-columns: 1fr; } }
/* === fim DASHBOARD MODO DENSO === */

/* =========================================================
   DASHBOARD — ENTRADA COM IMPACTO ("uau") + visual premium
   Animação de entrada em cascata + hero animado + cards premium
   + empty states convidativos. CSS puro; remover reverte tudo.
========================================================= */

@keyframes dashReveal {
	from { opacity: 0; transform: translateY(20px) scale(.985); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cascata: cada bloco entra com leve atraso encadeado */
.dash-kpi-grid > *,
.dash-strip,
.dash-onboarding,
.dash-actions-section,
.dash-charts-grid > *,
.dash-bottom-grid > * {
	opacity: 0;
	animation: dashReveal .55s cubic-bezier(.22,.61,.36,1) forwards;
}
.dash-kpi-grid > *:nth-child(1) { animation-delay: .08s; }
.dash-kpi-grid > *:nth-child(2) { animation-delay: .13s; }
.dash-kpi-grid > *:nth-child(3) { animation-delay: .18s; }
.dash-kpi-grid > *:nth-child(4) { animation-delay: .23s; }
.dash-kpi-grid > *:nth-child(5) { animation-delay: .28s; }
.dash-kpi-grid > *:nth-child(6) { animation-delay: .33s; }
.dash-kpi-grid > *:nth-child(7) { animation-delay: .38s; }
.dash-kpi-grid > *:nth-child(8) { animation-delay: .43s; }
.dash-strip { animation-delay: .48s; }
.dash-onboarding { animation-delay: .42s; }
.dash-actions-section { animation-delay: .42s; }
.dash-charts-grid > *:nth-child(1) { animation-delay: .46s; }
.dash-charts-grid > *:nth-child(2) { animation-delay: .52s; }
.dash-charts-grid > *:nth-child(3) { animation-delay: .58s; }
.dash-bottom-grid > * { animation-delay: .62s; }

/* Hero premium: gradiente vivo animado + brilho de fundo + reveal */
.dash-hero {
	opacity: 0;
	background: linear-gradient(120deg, #0b1224, #1e293b 42%, #3730a3 100%);
	background-size: 200% 200%;
	box-shadow: 0 20px 45px -16px rgba(55,48,163,.55);
	position: relative;
	overflow: hidden;
	animation: dashReveal .6s cubic-bezier(.22,.61,.36,1) forwards,
	           dashHeroGlow 14s ease-in-out 1s infinite;
}
@keyframes dashHeroGlow {
	0%, 100% { background-position: 0% 50%; }
	50%      { background-position: 100% 50%; }
}
.dash-hero::after {
	content: "";
	position: absolute;
	top: -55%;
	right: -8%;
	width: 360px;
	height: 360px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(129,140,248,.35), transparent 68%);
	pointer-events: none;
}
.dash-hero > * { position: relative; z-index: 1; }

/* KPI cards premium: brilho que varre no hover + elevação + glow no ícone */
.dash-kpi-card {
	position: relative;
	overflow: hidden;
	box-shadow: 0 6px 22px -10px rgba(22,32,79,.22);
}
.dash-kpi-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.55) 50%, transparent 58%);
	transform: translateX(-130%);
	transition: transform .7s ease;
	pointer-events: none;
}
.dash-kpi-card:hover::before { transform: translateX(130%); }
.dash-kpi-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px -12px rgba(22,32,79,.30); }
.dash-kpi-icon { box-shadow: 0 6px 16px -6px currentColor; }

/* Valor do KPI com leve gradiente de marca */
.dash-kpi-value {
	background: linear-gradient(135deg, #16204f, #4f46e5);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.theme-dark .dash-kpi-value {
	background: linear-gradient(135deg, #f8fafc, #a5b4fc);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* Empty states convidativos (painéis sem dados) */
.dash-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	height: 100%;
	min-height: 220px;
	padding: 24px;
	gap: 4px;
}
.dash-empty-icon {
	width: 56px;
	height: 56px;
	border-radius: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: #4650D4;
	background: linear-gradient(135deg, #eef2ff, #e0e7ff);
	margin-bottom: 8px;
	animation: dashEmptyFloat 3s ease-in-out infinite;
}
@keyframes dashEmptyFloat {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-6px); }
}
.dash-empty-state strong { font-size: 15px; color: #16204f; }
.dash-empty-state span { font-size: 12.5px; color: #94a3b8; max-width: 280px; line-height: 1.5; }
.dash-empty-cta {
	margin-top: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 10px;
	background: var(--bm-blue, #4650D4);
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	transition: transform .15s, box-shadow .15s;
	box-shadow: 0 4px 14px -4px rgba(79,107,255,.6);
}
.dash-empty-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -6px rgba(79,107,255,.7); }
.theme-dark .dash-empty-icon { background: linear-gradient(135deg, #1e293b, #312e81); }
.theme-dark .dash-empty-state strong { color: #f8fafc; }

/* Acessibilidade: respeita quem prefere menos animação */
@media (prefers-reduced-motion: reduce) {
	.dash-kpi-grid > *, .dash-strip, .dash-onboarding, .dash-actions-section,
	.dash-charts-grid > *, .dash-bottom-grid > *, .dash-hero {
		opacity: 1 !important;
		animation: none !important;
	}
	.dash-empty-icon { animation: none; }
}
/* === fim DASHBOARD ENTRADA COM IMPACTO === */

/* =========================================================
   DASHBOARD — MAIS COR E VIDA (reduz o "muito branco")
   Banho de cor por variante de KPI + cabeçalhos de painel com
   tinta e ícone em pill colorido. Escopo .theme-light p/ não
   afetar o tema escuro.
========================================================= */
.theme-light .dash-kpi-card-blue   { background: linear-gradient(135deg, #ffffff, #eef2ff) !important; }
.theme-light .dash-kpi-card-green  { background: linear-gradient(135deg, #ffffff, #ecfdf5) !important; }
.theme-light .dash-kpi-card-amber  { background: linear-gradient(135deg, #ffffff, #fffbeb) !important; }
.theme-light .dash-kpi-card-rose   { background: linear-gradient(135deg, #ffffff, #fff1f2) !important; }
.theme-light .dash-kpi-card-pink   { background: linear-gradient(135deg, #ffffff, #fdf2f8) !important; }
.theme-light .dash-kpi-card-violet { background: linear-gradient(135deg, #ffffff, #f5f3ff) !important; }
.theme-light .dash-kpi-card-cyan   { background: linear-gradient(135deg, #ffffff, #ecfeff) !important; }

/* Cabeçalho dos painéis com leve gradiente + ícone em pill colorido */
.theme-light .dash-panel-header {
	background: linear-gradient(135deg, rgba(79,107,255,.06), transparent 70%);
}
.theme-light .dash-panel-header i {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #eef2ff, #e0e7ff);
	color: #4650D4;
}

/* Fundo do conteúdo com leve profundidade (menos branco chapado) */
.theme-light .content {
	background:
		radial-gradient(1100px 480px at 85% -12%, rgba(79,107,255,.07), transparent 60%),
		var(--bm-bg);
}

/* Barras de distribuição (prioridade/status) mais arredondadas */
.bar-track { border-radius: 8px; }
.bar-fill  { border-radius: 8px; }
/* === fim DASHBOARD MAIS COR E VIDA === */

/* Margin utilities extra */
.mb-12 { margin-bottom: 12px !important; }
.mb-8  { margin-bottom: 8px  !important; }

