:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --success: #10b981;
    --success-bg: #d1fae5;
    --success-dark: #065f46;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #e0f2fe;
    --warning: #f59e0b;
    --radius-sm: 4px;
    --radius-md: 8px;
    
    /* Cores adicionais inferidas */
    --google-color: #DB4437;
    --dark-blue-text: #103358;
    --sky-dark: #0c4a6e;
    --border-color: #e2e8f0;
    --dashed-border: #cbd5e1;
}

/* --- Utilitários Gerais --- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-150 { width: 150px; }
.h-40 { height: 40px; }

.hidden { display: none; }
.d-block { display: block; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.flex-wrap { flex-wrap: wrap; }
.nowrap { white-space: nowrap; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold, .font-700 { font-weight: 700; }
.font-600 { font-weight: 600; }

.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 5px; }
.mb-4 { margin-bottom: 1rem; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.p-0 { padding: 0 !important; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }

.radius-sm { border-radius: var(--radius-sm); }

/* --- Cores de Texto e Fundo --- */
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-success-dark { color: var(--success-dark); }
.text-info { color: var(--info); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.bg-success-light { background: var(--success-bg); }
.bg-success-dark-text { background: var(--success-bg); color: #065f46; }
.bg-primary-light { background: var(--primary-light); }
.bg-info-light { background: var(--info-bg); }
.bg-danger-light { background: var(--danger-bg); }
.bg-sky-light { background: #e0f2fe; }
.text-sky-dark { color: #0c4a6e; }
.bg-slate-50 { background: #f8fafc; }
.bg-slate-100 { background: #f1f5f9; }
.bg-gray-dark { background: #374151; }

.border-slate { border: 1px solid var(--border-color); }
.border-b-body { border-bottom: 1px solid var(--bg-body); }
.border-l-success { border-left: 4px solid var(--success); }
.border-l-info { border-left: 4px solid var(--info); }
.border-l-primary { border-left: 4px solid var(--primary); }

/* --- Tamanhos de Texto --- */
.text-small { font-size: 0.85rem; }
.text-09 { font-size: 0.9rem; }
.text-095 { font-size: 0.95rem; }
.text-11 { font-size: 1.1rem; }

/* --- Componentes Específicos --- */

/* Auth Screen */
.auth-brand-container {
    justify-content: center;
    color: var(--text-main);
    margin-bottom: 10px;
}

.btn-google {
    margin-top: 10px;
    color: var(--google-color);
    font-weight: bold;
}

.link-action {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.brand-footer {
    color: var(--dark-blue-text);
    margin-bottom: 30px;
    margin-top: 15px;
}

/* Sidebar & Navigation */
.btn-logout-mini {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
}

/* Inputs */
.input-readonly {
    background: #e2e8f0;
    cursor: not-allowed;
}

.input-large-currency {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-main);
}
#venda-valor {
    font-size: 1.5rem; 
    text-align: center; 
    font-weight: bold;
}

/* Cards & Sections */
.fipe-data-container {
    background: var(--bg-body);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.section-title {
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-uppercase {
    font-size: 0.9rem;
    text-transform: uppercase;
}

.section-divider {
    border-top: 1px dashed var(--dashed-border);
    padding-top: 20px;
    margin-top: 20px;
}

.card-title {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.chart-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 0;
}

.total-estimate-card {
    background: #0f172a;
    color: white;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-large-bold {
    font-size: 1.4rem;
    font-weight: 700;
}

.btn-large-pad {
    padding: 15px;
    font-size: 1rem;
}

.grid-2-col {
    grid-template-columns: 1fr 1fr;
}

/* Modais */
.modal-content-large {
    background: var(--bg-body);
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    border-radius: var(--radius-md);
}

.modal-content-medium {
    width: 95%;
    max-width: 450px;
}

.modal-content-pdf {
    background: var(--bg-surface);
    width: 95%;
    max-width: 800px;
    height: 90vh;
    border-radius: var(--radius-md);
}

.btn-close-modal {
    border: none; 
    background: none; 
    cursor: pointer;
}

.btn-icon {
    border: none;
    background: none;
    cursor: pointer;
}
.btn-icon-lg {
    border: none;
    background: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-header-static {
    position: static;
    border-bottom: none;
}

.iframe-full {
    width: 100%;
    height: 100%;
    border: none;
}

/* Divider Lines */
.divider-line {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.divider-dashed {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--dashed-border);
    display: flex;
    justify-content: space-between;
}
.total-estimate-divider {
    margin-top: 15px; 
    padding-top: 15px; 
    border-top: 1px dashed var(--dashed-border); 
    display: flex; 
    justify-content: space-between;
}

.opcionais-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.empty-table-msg {
    padding: 20px;
    color: var(--dashed-border);
}

/* Ajustes de tabelas e gráficos que estavam inline */
.chart-placeholder {
    position: relative;
    /* Adicione altura se necessário, ex: height: 200px; */
}        /* --- 1. DESIGN SYSTEM (TOKENS) --- */
        :root {
            /* Cores da Marca */
            --primary: #016dc5; /* Indigo 600 - Cor Principal */
            --primary-hover: #4338ca;
            --primary-light: #e0e7ff;
            
            --secondary: #64748b; /* Slate 500 */
            --success: #10b981;   /* Emerald 500 */
            --success-bg: #d1fae5;
            --danger: #ef4444;    /* Red 500 */
            --danger-bg: #fee2e2;
            --warning: #f59e0b;   /* Amber 500 */
            --premium: #f59e0b;   /* Amber 500 para Premium/Diamante */
            --info: #06b6d4; /* Cyan 500 */
            --info-bg: #cffafe;
            
            /* Fundos */
            --bg-body: #f1f5f9;   /* Slate 100 */
            --bg-surface: #ffffff;
            --bg-sidebar: #0f172a; /* Slate 900 */

            /* Tipografia */
            --text-main: #0f172a;  /* Slate 900 */
            --text-muted: #64748b; /* Slate 500 */
            --text-light: #94a3b8; /* Slate 400 */
            --text-white: #ffffff;

            /* Espaçamento e Bordas */
            --radius-sm: 6px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            
            --font-family: 'Inter', sans-serif;
        }

        /* --- ÍCONE DIAMANTE NO HEADER --- */
.diamond-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: #f59e0b; /* Cor Dourada/Ambar */
    background: #fffbeb;
    margin-right: 10px;
    position: relative;
}

.diamond-icon:hover {
    background: #fcd34d;
    color: #78350f;
    transform: scale(1.1);
}

/* Animação suave para chamar atenção */
.diamond-pulse {
    animation: diamondPulse 2s infinite;
}

@keyframes diamondPulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* --- TELA DE ASSINATURA --- */
.sub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .sub-grid { grid-template-columns: 1fr; }
}

.sub-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

/* Barra de Progresso do Trial */
.trial-progress-container {
    background: #f1f5f9;
    border-radius: 20px;
    height: 15px;
    width: 100%;
    margin: 20px 0;
    overflow: hidden;
}

.trial-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    border-radius: 20px;
    transition: width 1s ease-in-out;
}

.plan-feature-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.plan-feature-list li {
    margin-bottom: 12px;
    color: #475569;
    display: flex;
    align-items: center;
}

.plan-feature-list li i {
    color: #10b981;
    margin-right: 10px;
    font-size: 1.1rem;
}
        
        /* --- DARK MODE (IMPLEMENTAÇÃO) --- */
        body.dark-mode {
            --bg-body: #111827;     /* Gray 900 */
            --bg-surface: #1f2937;  /* Gray 800 */
            --bg-sidebar: #1f2937;
            --text-main: #f3f4f6;   /* Gray 100 */
            --text-muted: #9ca3af;  /* Gray 400 */
            --text-light: #6b7280;  /* Gray 500 */
            --primary-light: #4338ca; /* Indigo 700 */
            --secondary: #6b7280;   /* Gray 500 */
            
            /* Ajustes de Componentes */
            .card { border: 1px solid #374151; box-shadow: none; } /* Gray 700 */
            .sidebar { background: var(--bg-sidebar); }
            .nav-item:hover, .nav-item.active { background: #374151; color: white; }
            .date-badge { background: var(--bg-surface); border-color: #374151; color: var(--text-main); }
            .top-icon { background: var(--bg-surface); color: var(--primary); box-shadow: none; }
            .top-icon:hover { background: #374151; }

            input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, input[type="time"], input[type="number"] {
                background: #374151; 
                border-color: #4b5563; 
                color: var(--text-main);
            }
            input:focus, select:focus { 
                border-color: var(--primary); 
                background: #1f2937; 
                box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4); 
            }
            .upload-area, .document-area {
                background: #374151; 
                border-color: #4b5563; 
                color: var(--text-muted);
            }
             .upload-area:hover, .document-area:hover { 
                border-color: var(--primary); 
                background: #1f2937; 
             }
            .opcional-tag { background: #374151; color: var(--text-muted); }
            
            /* Modal */
            .modal-content { background: var(--bg-surface); }
            .modal-header { background: var(--bg-surface); border-bottom-color: #374151; }
            .modal-body { background: var(--bg-body); }
            
            /* Table */
            th { background: #374151; color: var(--text-muted); border-bottom-color: #374151; }
            td { border-bottom-color: #374151; }
            tr:hover td { background: #1f2937; }
            
            /* Venda Modal */
            #box-catira { background: #374151; border-color: #4b5563; }
            
            /* Log Item */
            .log-item { border-bottom: 1px dashed #4b5563; }

            /* CORREÇÃO DE CONTRASTE - Valores Financeiros */
            #tabela-estoque td { color: var(--text-main); }
            /* Corrigindo os valores financeiros, usando cores mais fortes para Dark Mode */
            #tabela-estoque tr td:nth-child(2) { color: var(--success); }
            .kpi-value { color: var(--text-main) !important; }
            
            /* Garantindo que o badge seja legível no Dark Mode */
            .badge-primary, .badge-success, .badge-danger, .badge-warning { color: var(--text-main) !important; }
            .badge-primary { background: #4338ca; } /* Indigo 700 para fundo escuro */
            .badge-success { background: #047857; } /* Teal 700 para fundo escuro */
            .fipe-tag { background: #9333ea; } /* Purple para fundo escuro */
            
            /* Revertendo a cor principal para os links/strongs que usam o primary */
            a { color: var(--primary); }
            
        }

        /* --- 2. RESET & BASE --- */
        * { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }
        body { background-color: var(--bg-body); color: var(--text-main); font-family: var(--font-family); height: 100vh; display: flex; overflow: hidden; font-size: 14px; }
        a { text-decoration: none; cursor: pointer; color: inherit; }
        ul { list-style: none; }
        input, select, button { font-family: inherit; }

        /* --- 3. UTILITÁRIOS --- */
        .hidden { display: none !important; }
        .flex { display: flex; }
        .flex-col { flex-direction: column; }
        .items-center { align-items: center; }
        .justify-between { justify-content: space-between; }
        .gap-10 { gap: 10px; }
        .gap-20 { gap: 20px; }
        .mt-4 { margin-top: 1rem; }
        .mb-4 { margin-bottom: 1rem; }
        .w-full { width: 100%; }
        .text-center { text-align: center; }
        .font-bold { font-weight: 700; }

        body.no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important; /* Garante que trave até em iPhones teimosos */
    width: 100% !important;
}
        
        /* Badges */
        .badge { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
        .badge-success { background: var(--success-bg); color: var(--success); }
        .badge-danger { background: var(--danger-bg); color: var(--danger); }
        .badge-primary { background: var(--primary-light); color: var(--primary); }
        .badge-warning { background: #fff7ed; color: var(--warning); }
        .fipe-tag { background: #7c3aed; color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.7em; font-weight: 700; margin-left: 5px; }
        
        /* Tags de Status de Assinatura */
        /* Aplicando estilos fortes para garantir destaque */
        .tag-status { font-weight: 700; font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; }
        .tag-status-teste { background: #fef3c7; color: #b45309; }
        .tag-status-pro { background: var(--success-bg); color: #065f46; }
        .tag-status-vitalicia { background: #e0f2fe; color: #0c4a6e; }
        .tag-status-expirado { background: var(--danger-bg); color: var(--danger); }

        /* --- 4. COMPONENTES --- */
        
        /* Botões */
        .btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 500; border: none; cursor: pointer; transition: all 0.2s ease; gap: 8px; font-size: 0.9rem; }
        .btn:active { transform: scale(0.98); }
        .btn-primary { background-color: var(--primary); color: white; box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2); }
        .btn-primary:hover { background-color: var(--primary-hover); }
        .btn-secondary { background-color: white; border: 1px solid #cbd5e1; color: var(--text-main); }
        .btn-secondary:hover { background-color: #f8fafc; border-color: #94a3b8; }
        .btn-danger { background-color: var(--danger); color: white; }
        .btn-success { background-color: var(--success); color: white; }
        .btn-sm { padding: 6px 12px; font-size: 0.8rem; }

        /* Cards */
        .card { background: var(--bg-surface); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid #e2e8f0; transition: transform 0.2s; }
        /* .card:hover { box-shadow: var(--shadow-md); } */

        /* Inputs */
        .input-group { margin-bottom: 15px; }
        .input-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-main); font-size: 0.9rem; }
        input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, input[type="time"], input[type="number"] {
            width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm);
            background: #f8fafc; transition: all 0.2s; font-size: 0.95rem; color: var(--text-main);
        }
        input:focus, select:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px var(--primary-light); }
        
        /* Toggle Switch (NOVO) */
        .switch { position: relative; display: inline-block; width: 40px; height: 24px; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider {
            position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
            background-color: #ccc; transition: .4s; border-radius: 24px;
        }
        .slider:before {
            position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px;
            background-color: white; transition: .4s; border-radius: 50%;
        }
        input:checked + .slider { background-color: var(--primary); }
        input:checked + .slider:before { transform: translateX(16px); }

        /* Documentos */
        .document-area { 
            border: 2px dashed #e2e8f0; border-radius: var(--radius-md); padding: 15px; text-align: center;
            cursor: pointer; transition: 0.2s; background: #f8fafc; color: var(--text-muted);
            margin-bottom: 15px;
        }
        .document-area:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
        .doc-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }
        .doc-item {
             display: flex; align-items: center; justify-content: space-between; flex: 1 1 45%; 
             padding: 8px 12px; border: 1px solid #e2e8f0;
             border-radius: var(--radius-sm); background: white; font-size: 0.9rem;
        }
        .doc-item-link { 
             color: var(--primary); 
             font-weight: 500; 
             cursor: pointer; 
             display: flex; 
             align-items: center; 
             gap: 8px; 
             /* Fix para garantir que o texto não quebre o layout */
             max-width: calc(100% - 30px);
             white-space: nowrap;
             overflow: hidden;
             text-overflow: ellipsis;
        }
        .doc-item button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.8rem; padding: 0; margin-left: 10px; }

        /* Área de Upload */
        .upload-area { 
            border: 2px dashed #cbd5e1; border-radius: var(--radius-md); padding: 30px; text-align: center;
            cursor: pointer; transition: 0.2s; background: #f8fafc; color: var(--text-muted);
        }
        .upload-area:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
        
        /* Checkbox Opcionais */
        .checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
        .checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; user-select: none; }
        .checkbox-item input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
        .opcional-tag { background: #f1f5f9; color: var(--text-muted); padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: 500; display: inline-block; margin-right: 8px; margin-bottom: 5px; }

        /* Tabelas */
        .table-container { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid #e2e8f0; }
        table { width: 100%; border-collapse: collapse; background: white; }
        th { text-align: left; padding: 16px; background: #f8fafc; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; font-weight: 600; border-bottom: 1px solid #e2e8f0; }
        td { padding: 16px; border-bottom: 1px solid #f1f5f9; color: var(--text-main); vertical-align: middle; }
        tr:last-child td { border-bottom: none; }
        tr:hover td { background: #f8fafc; cursor: pointer; }
        
        /* Alerta de FIPE */
        .fipe-alert {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 2px 8px;
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
            font-weight: 600;
        }
        .fipe-alert.high { background: var(--danger-bg); color: var(--danger); }
        .fipe-alert.low { background: #fef3c7; color: #b45309; }


        /* Toast Notificação */
        #toast-container {
            position: fixed; 
            top: 20px; 
            right: 20px; 
            z-index: 9999; 
            display: flex;
            flex-direction: column; /* Empilha verticalmente */
            gap: 10px; /* Espaço entre os toasts */
            max-width: 350px;
        }

        .toast {
            padding: 16px 24px; 
            border-radius: var(--radius-md);
            background: white; 
            box-shadow: var(--shadow-lg); 
            border-left: 4px solid var(--success);
            display: flex; 
            align-items: center; 
            gap: 12px; 
            font-weight: 500;
            animation: slideInRight 0.3s cubic-bezier(0.2, 0, 0.2, 1);
            width: 100%;
        }
        .toast.error { border-left-color: var(--danger); }
        .toast.warning { border-left-color: var(--warning); }
        .toast.primary { border-left-color: var(--primary); }

      @keyframes border-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
        /* --- 5. FOTO DO VEÍCULO (WRAPPER INTERATIVO) --- */
        .vehicle-thumb-wrapper {
            position: relative;
            width: 80px; height: 80px;
            border-radius: var(--radius-md); overflow: hidden;
            background: #e2e8f0; border: 3px solid white; box-shadow: var(--shadow-md);
            cursor: pointer;
            transition: transform 0.2s;
        }
        .vehicle-thumb-wrapper:hover {
            transform: scale(1.05);
            border-color: var(--primary);
        }
        
        /* Botão Fixo de Câmera (Sempre visível) */
        .edit-badge-icon {
            position: absolute;
            bottom: 0;
            right: 0;
            background: var(--primary);
            color: white;
            width: 24px;
            height: 24px;
            display: flex; align-items: center; justify-content: center;
            border-top-left-radius: 8px;
            font-size: 0.7rem;
            z-index: 10; 
            box-shadow: -2px -2px 5px rgba(0,0,0,0.1);
        }

        .placeholder-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #94a3b8; background: #f1f5f9; }


        /* --- 6. LAYOUT --- */
        
        /* Auth Screen - Aprimoramento para Split Screen */
        .auth-screen { 
            position: fixed; 
            inset: 0; 
            background: var(--bg-surface); /* Fundo branco para a tela de login */
            z-index: 2000; 
            display: flex; 
            /* Altera de center para flex-start para acomodar o layout de dois painéis */
            justify-content: flex-start; 
            align-items: stretch; /* Garante que os filhos preencham a altura */
        }
        
        /* Painel de Promoção (Esquerdo) - Apenas para Desktop */
        #auth-promo {
            flex: 1; 
            /* Background com a imagem enviada */
            background-image: url('images/login.png'); 
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            display: none; /* Inicia oculto e é mostrado em desktop */
            position: relative;
            margin: 30px;
            border-radius: 30px;
        }

        /* Painel do Formulário (Direito) - Wrapper para centralizar em ambos */
        #auth-card-wrapper {
            width: 100%; /* Padrão Mobile */
            display: flex;
            justify-content: center;
            align-items: center;
            flex-shrink: 0;
        }

        .auth-card { 
            width: 90%; 
            max-width: 400px; 
            background: white; 
            padding: 40px; 
            border-radius: var(--radius-lg); 
            box-shadow: none; /* Remove shadow no card para o novo layout */
            text-align: center; 
        }

        /* Sidebar */
        .sidebar { width: 260px; background: var(--bg-sidebar); color: white; display: flex; flex-direction: column; padding: 24px; z-index: 50; }
        .brand { font-size: 1.5rem; font-weight: 800; color: white; margin-bottom: 40px; display: flex; align-items: center; gap: 10px; }
        .brand i { color: var(--primary); }
        
        .nav-links { flex: 1; display: flex; flex-direction: column; gap: 5px; }
        .nav-item { 
            display: flex; align-items: center; gap: 12px; padding: 12px 16px; 
            color: #94a3b8; border-radius: var(--radius-sm); transition: 0.2s; font-weight: 500;
        }
        .nav-item:hover, .nav-item.active { background: #1e293b; color: white; }
        .nav-item.active { border-left: var(--primary); }
        .user-mini { margin-top: auto; padding-top: 20px; border-top: 1px solid #1e293b; display: flex; align-items: center; gap: 10px; }
        .user-avatar { width: 40px; height: 40px; background: #1e293b; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary); }
        .user-mini-text { flex: 1; }

        /* Main Content - CORREÇÃO DE ESPAÇAMENTO DE DESKTOP (Aplicando regra mais forte) */
        .main { 
            flex: 1; 
            overflow-y: auto; 
            /* Reduzindo o padding lateral para 30px. O 32px no topo/fundo mantém o padrão. */
            padding: 32px 30px !important; 
            height: 100vh; 
        }
        
        /* Top Bar - Ajustada para ter flexibilidade de alinhamento */
        .top-bar { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            margin-bottom: 32px;
            position: relative; /* Para posicionamento absoluto do sino */
        }
        .page-title { font-size: 1.75rem; font-weight: 700; color: var(--text-main); }
        
        /* Contêiner de Ações (Data e Sino) */
        .top-actions {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .date-badge { background: white; padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; color: var(--text-muted); border: 1px solid #e2e8f0; font-weight: 500; }
        
        /* Sino de Notificações E Icone de Assinatura */
        .top-icon {
            background: var(--bg-surface);
            color: var(--primary);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            cursor: pointer;
            box-shadow: var(--shadow-sm);
            position: relative;
            transition: background 0.2s;
        }
        .top-icon:hover {
            background: var(--primary-light);
        }


        .notification-count {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--danger);
            color: white;
            border-radius: 50%;
            padding: 2px 6px;
            font-size: 0.7rem;
            font-weight: 700;
            line-height: 1;
        }

        /* Painel de Notificações */
        #notification-panel {
            position: absolute;
            top: 60px; /* Alinha abaixo da top-bar */
            right: 0;
            width: 300px;
            max-height: 400px;
            background: var(--bg-surface);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            z-index: 100;
            overflow-y: auto;
            border: 1px solid #e2e8f0;
            transform-origin: top right;
            animation: fadeInScale 0.2s ease-out;
        }
        .notification-header {
            padding: 15px;
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-main);
            border-bottom: 1px solid #f1f5f9;
        }
        .notification-list {
            padding: 0;
            margin: 0;
        }
        .notification-item {
            padding: 10px 15px;
            border-bottom: 1px solid #f1f5f9;
            cursor: default;
            transition: background 0.1s;
        }
        .notification-item:hover {
            background: #f8fafc;
        }
        .notification-item strong {
            display: block;
            font-size: 0.9rem;
            color: var(--primary);
        }
        .notification-item small {
            display: block;
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 3px;
        }
        .notification-empty {
            padding: 30px 15px;
            text-align: center;
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        @keyframes fadeInScale {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }


        /* Dashboard Grid */
        .kpi-grid { display: grid; gap: 24px; margin-bottom: 32px; }
        
        /* NOVO: Classes para forçar o número de colunas em desktop */
        .kpi-grid-4-col { grid-template-columns: repeat(4, 1fr); }
        .kpi-grid-3-col { grid-template-columns: repeat(3, 1fr); }
        
        .kpi-card { display: flex; flex-direction: column; gap: 5px; }
        .kpi-label { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
        .kpi-value { font-size: 2rem; font-weight: 700; color: var(--text-main); }
        .kpi-icon-wrapper { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 10px; }
        
        /* Modal */
        .modal-overlay {
            position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 1000;
            display: flex; justify-content: center; align-items: center;
        }
        /* CORREÇÃO MODAL: Adiciona scroll e altura máxima geral */
        .modal-content { 
            display: flex; 
            flex-direction: column; 
            overflow: hidden; 
            margin: auto;
            background: var(--bg-surface);
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-lg);
            max-height: 90vh; 
            overflow-y: auto; 
        }
        
        /* HEADER FIXO - CRUCIAL PARA O UX DO SCROLL */
        .modal-header { 
            padding: 20px 24px; 
            border-bottom: 1px solid #e2e8f0; 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            background: var(--bg-surface); /* Usa a cor de fundo do surface */
            z-index: 50; 
            position: sticky; 
            top: 0;
            flex-shrink: 0; 
        }
        .modal-body { 
            padding: 24px; 
            overflow-y: auto; 
            flex: 1; 
            background: #f8fafc; 
        }
        
        /* NOVO: Estilo para o conteúdo interno de modais de formulário (ex: Registrar Saída) */
        .modal-content-form {
            padding: 40px; /* Padding padrão para desktop/tablet */
            flex-grow: 1; /* Permite que o conteúdo expanda */
        }
        
        /* --- NOVO CSS PARA O FINANCEIRO DE ENTRADA --- */

.finance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Divide em 2 colunas iguais */
    gap: 15px;
    margin-top: 10px;
}

/* Estilo Base do Cartão */
.finance-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.finance-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--primary);
}

/* Ícone Lateral */
.finance-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.finance-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.finance-content label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-muted);
}

/* Input de Dinheiro Grande */
.input-money {
    border: none;
    background: transparent;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    width: 100%;
    outline: none;
    padding: 0;
}

.input-money::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

/* --- Variações Específicas --- */

/* Cartão de Custo (Cinza/Azulado) */
.cost-card {
    border-left: 4px solid #64748b;
    background: #f8fafc;
}
.cost-card .finance-icon {
    background: #e2e8f0;
    color: #64748b;
}

/* Cartão de Preço (Verde/Sucesso) */
.price-card {
    border-left: 4px solid var(--success);
    background: #f0fdf4; /* Fundo verde bem clarinho */
}
.price-card .finance-icon {
    background: #dcfce7;
    color: var(--success);
}
.price-card .input-money {
    color: var(--success-dark);
}

/* --- ESTILO NOVO PARA RELATÓRIOS --- */

/* Grid de KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-info strong {
    font-size: 1.4rem;
    line-height: 1.2;
    color: var(--text-main);
}

/* --- ESTILO UPLOAD DE LOGO --- */
.logo-upload-wrapper {
    position: relative;
    width: 150px;
    height: 80px; /* Altura fixa para manter padrão */
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.logo-upload-wrapper:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.logo-upload-wrapper img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* Garante que a logo não distorça */
}

/* Ajuste Dark Mode */
body.dark-mode .logo-upload-wrapper {
    background: #374151;
    border-color: #4b5563;
}

/* Variações de Cores dos Cards KPI */
.kpi-success .kpi-icon { background: #dcfce7; color: #16a34a; }
.kpi-success { border-bottom: 4px solid #16a34a; }

.kpi-info .kpi-icon { background: #e0f2fe; color: #0284c7; } /* Nome da classe conflitante com bootstrap, usando contexto */
.kpi-card.kpi-info .kpi-icon { background: #e0f2fe; color: #0284c7; }
.kpi-card.kpi-info { border-bottom: 4px solid #0284c7; }

.kpi-warning .kpi-icon { background: #fef3c7; color: #d97706; }
.kpi-warning { border-bottom: 4px solid #d97706; }

.kpi-danger .kpi-icon { background: #fee2e2; color: #dc2626; }
.kpi-danger { border-bottom: 4px solid #dc2626; }

/* Grid de Gráficos */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr; /* O gráfico de barras ocupa mais espaço que o de pizza */
    gap: 20px;
}

@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr; /* Um embaixo do outro no celular/tablet */
    }
}

.uppercase { text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.border-bottom { border-bottom: 1px solid #f1f5f9; }
.pb-10 { padding-bottom: 10px; }

/* Responsividade para Celular */
@media (max-width: 600px) {
    .finance-grid {
        grid-template-columns: 1fr; /* Em celular, um embaixo do outro */
    }
}


        /* FAQ Styling */
        .faq-item { border: 1px solid #e2e8f0; border-radius: var(--radius-sm); margin-bottom: 10px; background: white; overflow: hidden; }
        .faq-question { padding: 15px 20px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: #fdfdfd; }
        .faq-answer { max-height: 0; padding: 0 20px; overflow: hidden; transition: 0.3s ease; color: var(--text-muted); line-height: 1.5; }
        .faq-item.active .faq-answer { max-height: 300px; padding: 15px 20px; border-top: 1px solid #f1f5f9; }
        
        /* Estilos da Tela de Assinatura */
        /* NOVO: Container para o split screen - SEM GAP */
        #view-assinatura-wrapper {
            display: flex;
            align-items: stretch;
            gap: 0; /* REMOVIDO ESPAÇAMENTO */
            max-width: 900px; 
            margin: 0 auto;
            box-shadow: var(--shadow-lg); /* Adicionado sombra para parecer um bloco único */
            border-radius: var(--radius-lg); 
            overflow: hidden; /* Garante que as bordas arredondadas funcionem */
            border: 1px solid #e2e8f0;
        }

        #view-assinatura .card {
            border-left: 4px solid var(--primary);
            width: 100%;
            margin: 0;
            text-align: center;
            border: none; /* Remove a borda do card interno */
            box-shadow: none; /* Remove a sombra do card interno */
            border-radius: 0; /* Remove bordas internas */
            flex-grow: 1;
        }
        #view-assinatura h3 {
            font-size: 1.5rem;
            margin-bottom: 10px;
        }
        #view-assinatura h4 {
            font-size: 1.1rem;
            color: var(--text-muted);
            margin-bottom: 20px;
        }
        #subscription-status-display {
            font-size: 1.2rem;
            font-weight: 700;
            padding: 10px 20px;
            border-radius: var(--radius-sm);
            display: inline-block;
            margin-bottom: 30px;
        }

        /* NOVO: Div para a imagem promocional */
        #assinatura-promo-image {
            flex: 1; 
            min-height: 400px;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            display: none; /* Inicia oculto em mobile */
        }
        
        /* --- 7. RESPONSIVE / MOBILE-FIRST --- */
        
        /* 1. Base Mobile */
        @media (max-width: 768px) {
            
            /* Ajustes gerais de layout para mobile */
            body { 
                flex-direction: column; 
                overflow-y: auto; 
                height: auto; 
                padding-bottom: 75px; /* Aumentado para acomodar o perfil na nav bar */
                font-size: 14px;
            }
            .sidebar { display: none; } /* Esconde o sidebar padrão em mobile */
            .main { flex: 1; overflow-y: auto; padding: 15px; height: auto; }
            .top-bar { margin-bottom: 20px; }
            .page-title { font-size: 1.5rem; }
            
            /* Esconde a data e muda o sino em mobile */
            .date-badge { display: none; } 
            
            .top-icon {
                background: none;
                box-shadow: none;
                width: 30px;
                height: 30px;
                color: var(--primary);
                font-size: 1.2rem;
            }
            #notification-bell {
                 color: var(--primary);
            }

            #notification-panel {
                top: 50px; 
                width: 95%;
                right: 2.5%;
            }

            /* Esconde textos desnecessários na navegação lateral (agora superior em telas maiores) */
            .user-mini { padding-top: 15px; border-top: none; } /* Ajuste o user-mini */
            .user-mini-text { display: none !important; } /* Esconde texto do perfil no desktop nav bar (que está oculta) */


            /* Grid de Formulários/Botões */
            .form-row { flex-direction: column; gap: 15px; }
            
            /* Inputs menores para melhor preenchimento */
            input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, input[type="time"], input[type="number"] {
                padding: 12px;
            }

            /* Auth Screen: Aumenta o padding do card para o topo */
            .auth-card { padding: 30px 20px; }

            /* Cards */
            .card { padding: 20px; border-radius: var(--radius-lg); }
            
            /* Tabela: Altera o comportamento da tabela para um layout de cartão */
            .table-container { border: none; }
            table { width: 100%; }
            th { display: none; } /* Esconde o cabeçalho da tabela */
            
            /* Altera a exibição de cada linha para se parecer com um Card */
            td { 
                display: block; 
                padding: 10px 0;
                border-bottom: none;
                font-size: 0.95rem;
            }
            tr:hover td { background: white; } /* Remove hover indesejado */

            /* --- CORREÇÃO: Estilização das Linhas da Tabela de Vendas (Dashboard) --- */
            #tabela-vendas-dash tbody tr {
                display: block;
                padding: 15px 0;
                border-bottom: 1px solid #e2e8f0; /* Adiciona o separador */
                margin-bottom: 0; /* Remove margem extra */
                transition: none; /* Remove transição de hover */
                cursor: default;
            }
            #tabela-vendas-dash tbody tr:last-child {
                border-bottom: none;
            }
            #tabela-vendas-dash td {
                padding: 5px 0; /* Ajusta o padding interno */
                display: flex;
                justify-content: space-between;
                align-items: center;
                font-size: 0.95rem;
            }
            #tabela-vendas-dash td:first-child {
                display: block; /* O primeiro item (Veículo e Data) deve ser um bloco para ocupar a largura total */
                font-size: 1rem;
            }
            /* Esconde o ROI na visualização Mobile por padrão, mostrando apenas o Lucro de forma mais clara */
            /* ATENÇÃO: A coluna 'Data e Hora' será a 4ª no HTML (índice 3), o ROI era a 5ª (índice 4). */
            /* A COLUNA ROI FOI REMOVIDA DO DASHBOARD. A 4ª coluna no desktop é 'Data e Hora'. */
            /* O 4º TD é o Lucro em mobile. O 5º TD foi removido. */

            /* AJUSTE MOBILE: O 4º TD é o Lucro. O 3º TD é o Valor Venda. */
            #tabela-vendas-dash tr td:nth-child(3)::before {
                /* Coluna de Lucro (3ª coluna no desktop) */
                content: "Lucro:";
                font-weight: 500;
                color: var(--text-muted);
                margin-right: 10px;
            }
             #tabela-vendas-dash tr td:nth-child(2)::before {
                /* Coluna de Valor Venda (2ª coluna no desktop) */
                content: "Valor Venda:";
                font-weight: 500;
                color: var(--text-muted);
                margin-right: 10px;
            }
            #tabela-vendas-dash tr td:nth-child(4)::before {
                /* Coluna de Data/Hora (4ª coluna no desktop) */
                content: "Data/Hora:";
                font-weight: 500;
                color: var(--text-muted);
                margin-right: 10px;
            }
            
            /* Ajuste no layout dos dados */
            #tabela-vendas-dash tr td:nth-child(3) {
                /* Exibe o Lucro como um item de linha separado */
                font-weight: 700;
            }
            
            /* Estilização das linhas da Tabela Estoque (Manter o estilo anterior) */
            #tabela-estoque tbody tr {
                display: flex;
                align-items: center;
                gap: 10px;
                background: var(--bg-surface);
                border: 1px solid #e2e8f0;
                border-radius: var(--radius-md);
                margin-bottom: 12px;
                padding: 15px;
                box-shadow: var(--shadow-sm);
                cursor: pointer;
            }
            
            #tabela-estoque td { 
                padding: 0; 
                border-bottom: none;
            }

            /* Estilo para a coluna do Veículo (que agora ocupa a maior parte) */
            #tabela-estoque td:nth-child(1) { flex: 1; }
            #tabela-estoque td:nth-child(2) { width: 90px; text-align: right; } /* Financeiro */
            #tabela-estoque td:nth-child(3) { width: 80px; text-align: center; } /* Status */
            
            /* KPI Grid: Forçar 1 coluna em Mobile */
            .kpi-grid, .kpi-grid-4-col, .kpi-grid-3-col { 
                grid-template-columns: 1fr; 
                gap: 15px;
            }
            .kpi-card { 
                flex-direction: row; 
                align-items: center; 
                justify-content: space-between;
                padding: 15px;
            }
            .kpi-value { font-size: 1.8rem; }
            .kpi-icon-wrapper { display: none; } /* Esconde o ícone grande para compactar */
            .kpi-label { margin-top: 5px; }

            /* Filtros de Estoque */
            #view-estoque .flex { flex-direction: column; }
            #view-estoque .flex.gap-10 { gap: 10px; }
            #filtro-busca, #filtro-status, #filtro-fipe-alert { width: 100% !important; }
            
            /* Modal de Detalhes */
            .modal-content { 
                width: 100%; 
                margin: 0; 
                border-radius: 0; 
                max-height: 100vh;
            }
            .modal-header { padding: 15px; }
            .modal-body { padding: 15px; }

            /* CORREÇÃO MODAL VENDA/CONTATO: Aplica o padding adequado em mobile */
            .modal-content-form {
                padding: 30px 20px;
            }

            /* Modal de Documentos (PDF Viewer) */
            #modal-pdf-viewer .modal-content {
                width: 95%;
                max-width: 95%;
            }
            
            /* Menu de Navegação Inferior (Aprimoramento Mobile) */
            .bottom-nav-bar {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                height: 75px; /* Aumentado para melhor toque e visualização */
                background: var(--bg-surface); /* Fundo branco ou claro */
                border-top: 1px solid #e2e8f0;
                display: flex;
                justify-content: space-around;
                align-items: center;
                z-index: 100;
                box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
            }

            .bottom-nav-bar .nav-item {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 3px;
                padding: 0;
                font-size: 0.7rem; 
                color: var(--text-muted);
                flex: 1;
            }

            .bottom-nav-bar .nav-item i {
                font-size: 1.3rem; /* Ícone um pouco maior */
                width: auto;
                margin-bottom: 2px;
            }

            .bottom-nav-bar .nav-item.active {
                color: var(--primary); 
            }
            
            /* NOVO: Estilo para o item de Perfil (User Mini) na nav bar inferior */
            .bottom-nav-bar #user-mini-mobile {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 3px;
                flex: 1;
                padding: 0;
                border-top: none;
                cursor: pointer;
            }
            
            /* Mostra o nome e status no item de perfil em mobile */
            .bottom-nav-bar #user-mini-mobile .user-mini-text { 
                display: flex !important; /* Força a exibição do container de texto */
                flex-direction: column;
                align-items: center;
                gap: 2px;
            }
            
            .bottom-nav-bar #user-mini-mobile .user-avatar {
                width: 30px;
                height: 30px;
                font-size: 0.8rem;
            }
            
            .bottom-nav-bar #user-mini-mobile strong {
                 font-size: 0.7rem; /* Nome menor */
                 max-width: 80px;
                 overflow: hidden;
                 white-space: nowrap;
                 text-overflow: ellipsis;
            }
            
            /* Ajuste para garantir que apenas um item de perfil seja exibido */
            .bottom-nav-bar .nav-item.profile-item {
                display: none; /* Oculta o item de navegação original do perfil */
            }
            
            /* Ajuste o estado padrão para a Visão Geral em Mobile */
            .bottom-nav-bar .nav-item {
                 display: flex;
            }
            .bottom-nav-bar .user-mini {
                display: flex; /* Garante que o perfil customizado seja sempre visível */
            }

            /* Assinatura em Mobile: Oculta a imagem e mostra o card normal */
            #view-assinatura-wrapper {
                flex-direction: column;
                box-shadow: none; /* Remove a sombra do wrapper */
                border: none;
            }
            #view-assinatura .card {
                border-radius: var(--radius-md);
                border: 1px solid #e2e8f0;
                box-shadow: var(--shadow-sm);
                margin: 0 auto;
                max-width: 600px;
            }
            #assinatura-promo-image {
                display: none;
            }
            
            /* Layout Mobile para Relatórios (Empilhar Filtros e Grid) */
            #view-relatorios .flex-col {
                flex-direction: column;
            }
            
        }
        
        /* Para telas maiores que 768px (Desktop/Tablet) */
        @media (min-width: 769px) {
            .bottom-nav-bar { display: none; }
            
            /* Auth Screen - Layout de dois painéis */
            .auth-screen {
                justify-content: flex-end; /* Alinha o conteúdo à direita */
            }
            
            #auth-promo {
                display: block; /* Mostra a imagem de promoção */
                width: 55%; /* Ocupa 55% da tela */
            }
            
            #auth-card-wrapper {
                width: 45%; /* Ocupa 45% da tela */
            }
            

            /* CORREÇÃO MODAL DESKTOP/TABLET: Centraliza e limita a largura */
            .modal-content {
                width: 90%; 
                max-width: 600px;
                border-radius: var(--radius-md);
            }
            #modal-pdf-viewer .modal-content {
                max-width: 800px;
                width: 800px;
                border-radius: var(--radius-md);
            }

            /* Estilos de Assinatura (Desktop Split Screen) */
            #view-assinatura-wrapper {
                max-width: 100%; 
                align-items: stretch;
            }
            
            /* CORREÇÃO VISUALIZAÇÃO: Exibir a imagem */
            #assinatura-promo-image {
                display: block; /* Mostra a imagem em desktop */
                flex: 1; 
                min-height: 500px;
                /* Adicionado para garantir que o fundo seja azul escuro, simulando o ambiente da imagem */
                background-color: #0f172a; 
                /* Garantir que o conteúdo não escale a imagem, mas a exibe (já estava lá, mas reconfirmado) */
                background-size: cover; 
                background-position: center;
                border-radius: 0 var(--radius-lg) var(--radius-lg) 0; /* Apenas lado direito arredondado */
            }
            
            #view-assinatura .card {
                flex: 1; /* Ocupa 50% */
                min-height: 500px; 
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                border-right: 1px solid #e2e8f0; /* Linha sutil de separação */
                border-radius: var(--radius-lg) 0 0 var(--radius-lg); /* Apenas lado esquerdo arredondado */
                
            }
            
            /* AJUSTE NA TABELA DO DASHBOARD */
            #tabela-vendas-dash th:nth-child(4), #tabela-vendas-dash td:nth-child(4) {
                 /* Alinha Data e Hora à direita para melhor visualização na coluna final */
                text-align: right;
            }
        }
        
        /* Ajuste do grid para tablet/telas menores que desktop (para evitar desalinhamento) */
        @media (min-width: 769px) and (max-width: 1200px) {
             /* Forçar 2 colunas para manter o padrão par */
             .kpi-grid, .kpi-grid-4-col, .kpi-grid-3-col { 
                grid-template-columns: repeat(2, 1fr); 
                gap: 20px;
             }
        }
        
        @media (min-width: 1201px) {
             /* Volta a forçar 4 colunas em telas maiores */
             .kpi-grid-4-col { 
                grid-template-columns: repeat(4, 1fr); 
                gap: 24px;
             }
             /* NOVO: Força 3 colunas para o segundo bloco */
             .kpi-grid-3-col {
                 grid-template-columns: repeat(3, 1fr); 
                 gap: 24px;
             }
        }


        .logo_login{
            max-width: 250px;
           
        }
        
        /* Estilos específicos para o Modal de Termos de Uso */
        .termos-container { 
            max-width: 800px;
            width: 90%;
            background: white; 
            border-radius: var(--radius-lg); 
            box-shadow: var(--shadow-lg); 
            text-align: left;
            display: flex;
            flex-direction: column;
            max-height: 90vh;
            overflow: hidden;
        }
        .termos-content {
            padding: 30px;
            overflow-y: auto;
            line-height: 1.6;
            font-size: 0.95rem;
            color: var(--text-main);
        }
        .termos-content h3 { margin-top: 20px; margin-bottom: 10px; font-size: 1.3rem; color: var(--primary); }
        .termos-content h4 { margin-top: 15px; margin-bottom: 5px; font-size: 1.1rem; color: var(--text-main); }
        .termos-actions { 
            padding: 20px 30px; 
            border-top: 1px solid #e2e8f0; 
            background: var(--bg-surface); 
            display: flex; 
            justify-content: flex-end; 
            gap: 15px;
        }

        /* Otimização do Logo no Sidebar (Novo) */
        .logo_system_menu {
            max-width: 150px;
            padding: 25px;
            margin: 0 auto;
            display: block;
            background-color: white;
            border-radius: 30px;
         
        }
        /* Ajuste do elemento .brand para centralizar a imagem */
        .sidebar .brand {
            justify-content: center; /* Centraliza a logo horizontalmente */
            padding: 5px 0;
            margin-bottom: 30px; /* Reduz ligeiramente a margem inferior para deixar mais compacto */
        }
        
        /* Estilos para o Log de Eventos no Modal de Detalhes */
        .log-list {
            list-style: none;
            padding: 0;
        }
        .log-item {
            padding: 8px 0;
            border-bottom: 1px dashed #f1f5f9;
            font-size: 0.85rem;
            color: var(--text-muted);
            display: flex;
            justify-content: space-between;
        }
        .log-item:last-child {
            border-bottom: none;
        }
        .log-item strong {
            color: var(--text-main);
            font-weight: 500;
        }
        
        /* Estilos para a tabela de Análise de Margem (Relatórios) */
        .table-ranking th:nth-child(2),
        .table-ranking td:nth-child(2) {
            text-align: right;
            width: 150px;
        }
        .table-ranking th:nth-child(3),
        .table-ranking td:nth-child(3) {
            text-align: right;
            width: 100px;
            color: var(--info);
            font-weight: 700;
        }
        
        /* Bloco de Gráfico (Placeholder para PDF) */
        .chart-placeholder {
            min-height: 200px;
            background: var(--bg-body);
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: var(--text-muted);
            margin-bottom: 20px;
            padding: 20px;
            position: relative; /* Adicionado para Chart.js */
        }
        
        /* NOVO: Garante que o canvas Chart.js preencha o container */
        .chart-placeholder canvas {
            height: 100% !important; 
            width: 100% !important;
        }
        
        .dark-mode .chart-placeholder {
            background: #1f2937;
            border-color: #374151;
            color: #4b5563;
        }

        /* --- DESIGN DETALHES DA VENDA (CUSTO/LUCRO) --- */

.sale-details-card {
    border-left: 4px solid var(--success);
    padding: 20px !important; /* Um pouco mais de espaço interno */
}

.sale-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.sale-header-row h4 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    color: var(--success);
    font-weight: 700;
}

.sale-date-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Grid para Venda e Custo */
.sale-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-box {
    background: var(--bg-body);
    padding: 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}
.stat-value.text-main { color: var(--text-main); }
.stat-value.text-muted { color: var(--text-light); }

/* Caixa de Destaque do Lucro */
.profit-highlight-box {
    background: var(--success-bg); /* Fundo verde claro */
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    padding: 15px 20px;
}

.profit-value {
    font-size: 1.6rem; /* Bem grande */
    color: var(--success); /* Verde forte */
    font-weight: 800;
    line-height: 1.2;
}

.text-success-dark {
    color: #15803d; /* Um verde um pouco mais escuro para o texto pequeno */
}

/* Badge de ROI */
.roi-badge {
    background: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    box-shadow: var(--shadow-sm);
    min-width: 70px;
}

.roi-badge small {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.roi-badge strong {
    color: var(--success);
    font-size: 1rem;
}

/* --- AJUSTES DARK MODE --- */
body.dark-mode .sale-header-row { border-bottom-color: #374151; }
body.dark-mode .sale-date-badge { background: #374151; color: var(--text-light); }
body.dark-mode .stat-box { background: #374151; }
body.dark-mode .profit-highlight-box { 
    background: rgba(16, 185, 129, 0.15); /* Verde translúcido no escuro */
    border-color: rgba(16, 185, 129, 0.3);
}
body.dark-mode .text-success-dark { color: #86efac; } /* Verde claro para texto */
body.dark-mode .roi-badge { background: #374151; color: var(--text-main); box-shadow: none; border: 1px solid #4b5563; }





/* --- CSS MOBILE CORRIGIDO v4 (BOTÃO REDONDO + SEM PERFIL) --- */
@media (max-width: 768px) {

    /* 1. RESET ESTRUTURAL */
    body {
        background-color: #f2f4f7 !important;
        font-family: 'Inter', sans-serif;
        padding-bottom: 0 !important;
    }
    .main { 
        padding: 16px !important; 
        padding-bottom: 110px !important;
    }

    /* Ocultar elementos desktop e PERFIL MOBILE */
    .sidebar, #auth-promo, .date-badge, .user-mini-text, .user-mini, #user-mini-mobile { display: none !important; }

    /* 2. HEADER E FILTROS */
    .top-bar {
        position: sticky; top: 0; z-index: 90;
        background: rgba(242, 244, 247, 0.95) !important;
        backdrop-filter: blur(10px);
        margin: -16px -16px 20px -16px !important;
        padding: 16px 20px !important;
        display: flex !important; justify-content: space-between !important; align-items: center !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    #view-estoque .card {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
    /* 2. Garante que a tabela e o container dela também sejam transparentes */
    #view-estoque .table-container,
    #view-estoque table,
    #view-estoque tbody {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* 3. Mantém o fundo branco APENAS nos cartões individuais (os veículos) */
    #tabela-estoque tbody tr {
        background: #ffffff !important; /* Branco no cartão */
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important; /* Sombra suave */
        margin-bottom: 12px !important; /* Espaço entre os cartões */
        border-radius: 16px !important; /* Arredondado moderno */
    }

    /* Opcional: Ajuste para remover espaços extras indesejados no topo */
    #view-estoque {
        padding-top: 0 !important;
    }
    /* --- FILTROS ESTOQUE: SEM FIPE (vFinal) --- */

    /* 1. Container Principal (Mantém o espaçamento para a lista de veículos) */
    #view-estoque .card > .flex {
        display: block !important;
        width: 100% !important;
        padding-bottom: 10px !important;
        margin-bottom: 25px !important; /* Espaço generoso até o primeiro carro */
        border-bottom: 1px solid #f1f5f9 !important;
    }

    /* 2. Container dos Inputs (Agora é uma lista vertical simples) */
    #view-estoque .card > .flex > .flex {
        display: flex !important;
        flex-direction: column !important; /* Um embaixo do outro */
        gap: 12px !important;
        width: 100% !important;
    }

    /* 3. Campo de Busca (100% Largura) */
    #filtro-busca {
        width: 100% !important;
        height: 50px !important; /* Altura confortável */
        border-radius: 12px !important;
        margin: 0 !important;
    }

    /* 4. Filtro de Status (100% Largura agora) */
    #filtro-status {
        width: 100% !important;
        height: 50px !important;
        border-radius: 12px !important;
        margin: 0 !important;
        background-color: #f8fafc !important; /* Fundo levemente diferente */
    }

    /* 5. OCULTAR ALERTA FIPE */
    #filtro-fipe-alert {
        display: none !important;
    }
    
    /* Remove configurações antigas de grid que podem atrapalhar */
    #filtro-busca {
        grid-area: auto !important; 
    }
    #filtro-busca { grid-area: busca; width: 100% !important; height: 45px !important; border-radius: 12px !important; }
    #view-estoque select { width: 100% !important; border-radius: 12px !important; background: white !important; }

    /* 3. CARDS DE ESTOQUE */
    /* 3. CARDS DE ESTOQUE (LAYOUT LISTA - BADGE NA DIREITA) */
    
    .table-container { border: none !important; background: transparent !important; overflow: visible !important; }
    
    /* Transforma tabelas em blocos flexíveis */
    #tabela-estoque, #tabela-estoque tbody, #tabela-estoque tr, #tabela-estoque td { 
        display: block !important; width: 100% !important; border: none !important;
    }
    #tabela-estoque thead { display: none !important; }
    #tabela-estoque tbody { display: flex !important; flex-direction: column !important; gap: 8px !important; }

    /* O CARD DO VEÍCULO */
    #tabela-estoque tbody tr {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        
        /* ALINHAMENTO IMPORTANTE: */
        align-items: flex-start !important; /* Alinha itens ao topo para separar Preço (Topo) de Badge (Fundo) */
        
        background: #ffffff !important;
        border-radius: 12px !important;
        padding: 8px 12px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
        border: 1px solid #f1f5f9 !important;
        position: relative !important;
        
        /* Altura mínima para caber Preço em cima e Badge embaixo */
        min-height: 84px !important; 
    }

    /* --- COLUNA 1: FOTO + INFO (Esquerda) --- */
    #tabela-estoque td:nth-child(1) {
        flex: 1 !important;
        display: flex !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        
        /* Centraliza a foto verticalmente no card (já que o card é alto) */
        align-self: center !important; 
    }

    #tabela-estoque td:nth-child(1) .flex {
        display: flex !important; flex-direction: row !important; align-items: center !important;
        gap: 12px !important; width: 100% !important;
    }

    /* FOTO */
    #tabela-estoque td:nth-child(1) div[style*="width:40px"], 
    #tabela-estoque td:nth-child(1) div[style*="width: 40px"] {
        width: 52px !important; height: 52px !important;
        min-width: 52px !important; border-radius: 8px !important;
        margin: 0 !important; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

    /* TEXTO */
    #tabela-estoque td:nth-child(1) .font-bold {
        font-size: 0.9rem !important; color: #1f2937 !important;
        line-height: 1.1 !important; margin-bottom: 3px !important;
        white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
        max-width: 48vw !important; display: block !important;
    }
    #tabela-estoque td:nth-child(1) small {
        font-size: 0.75rem !important; color: #94a3b8 !important; display: block !important;
    }

    /* --- COLUNA 2: PREÇO (Topo Direita) --- */
    #tabela-estoque td:nth-child(2) {
        position: static !important; width: auto !important; padding: 0 !important;
        text-align: right !important; margin-left: 10px !important;
        
        /* Posicionamento */
        margin-top: 4px !important; /* Encostado no topo (com leve respiro) */
        
        font-size: 0.95rem !important; font-weight: 800 !important;
        color: var(--primary) !important; white-space: nowrap !important;
    }

    /* --- COLUNA 3: BADGES (Fundo Direita) --- */
    #tabela-estoque td:nth-child(3) {
        position: absolute !important;
        right: 12px !important;
        bottom: 8px !important; /* Encostado no fundo */
        left: auto !important;
        padding: 0 !important;
        z-index: 10 !important;
        
        display: flex !important; flex-direction: column !important; 
        align-items: flex-end !important; /* Alinha tudo à direita */
        gap: 2px !important;
    }

    /* ESTILO DO BADGE (Limpo e Sólido) */
    .badge {
        font-size: 0.6rem !important; padding: 3px 8px !important;
        border-radius: 6px !important; position: static !important; transform: none !important;
        
        /* Remove estilos de vidro antigos */
        box-shadow: none !important; border: none !important;
        font-weight: 600 !important; letter-spacing: 0.3px !important;
    }
    
    /* Força as cores originais do sistema (Verde para vendido, Azul para disponível) */
    .badge-success { background-color: var(--success-bg) !important; color: var(--success) !important; }
    .badge-primary { background-color: var(--primary-light) !important; color: var(--primary) !important; }

    /* FIPE ALERT (Acima do badge, se existir) */
    .fipe-alert {
        position: relative !important; top: auto !important; right: auto !important;
        font-size: 0.6rem !important; padding: 1px 5px !important;
        margin-bottom: 2px !important;
    }

    /* --- 4. NAV BAR LIMPA E CORRIGIDA --- */
    .bottom-nav-bar {
        position: fixed !important; bottom: 20px; left: 15px; right: 15px;
        height: 65px !important; background: #1e293b !important;
        border-radius: 35px !important;
        box-shadow: 0 10px 25px -5px rgba(0,0,0,0.4) !important;
        display: flex !important; justify-content: space-around !important; /* Espaça igualmente os itens */
        align-items: center !important;
        padding: 0 10px !important;
        z-index: 999 !important;
    }

    .bottom-nav-bar .nav-item {
        flex: 1; /* Ocupa espaço igual */
        display: flex !important; flex-direction: column !important;
        align-items: center !important; justify-content: center !important;
        padding: 5px 0 !important; color: #94a3b8;
    }
    .bottom-nav-bar .nav-item i { font-size: 1.2rem !important; margin-bottom: 2px !important; }
    .bottom-nav-bar .nav-item span {
        font-size: clamp(9px, 2.5vw, 11px) !important; 
        white-space: nowrap !important; overflow: hidden !important;
    }

    /* CORREÇÃO DO BOTÃO CENTRAL (+) */
    #bottom-nav-entrada {
        /* Previne o Flexbox de esticar ou encolher o botão */
        flex: 0 0 50px !important; 
        
        /* Define dimensões exatas */
        width: 50px !important; 
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        
        background: var(--primary) !important; 
        border-radius: 50% !important; 
        color: white !important; 
        transform: translateY(-20px);
        box-shadow: 0 0 0 8px #f2f4f7 !important;
        display: flex !important; justify-content: center !important; align-items: center !important;
        overflow: visible !important;
        margin: 0 5px !important; /* Margem lateral segura */
    }
    #bottom-nav-entrada i { font-size: 1.4rem !important; margin: 0 !important; }

    /* 5. MODAIS & ACTIONS FIX */
    .modal-overlay {
        align-items: stretch !important; padding: 0 !important;
        background: var(--bg-surface) !important; z-index: 3000 !important;
    }
    .modal-content {
        width: 100% !important; height: 100% !important; max-height: 100vh !important;
        border-radius: 0 !important; margin: 0 !important; bottom: 0 !important;
        display: flex !important; flex-direction: column !important;
        box-shadow: none !important; border: none !important;
    }
    .modal-header {
        flex-shrink: 0; padding: 15px !important; border-bottom: 1px solid #e2e8f0;
        background: var(--bg-surface) !important;
    }
    .modal-body {
        flex: 1; overflow-y: auto !important; padding: 20px !important;
        padding-bottom: 100px !important;
    }
    #modal-pdf-viewer .modal-content { max-width: 100% !important; width: 100% !important; }

    /* Barra de Ações (Excluir/Vender) Fixa */
    #modal-actions {
        position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
        width: 100% !important; background: var(--bg-surface) !important; 
        padding: 15px 20px !important; border-top: 1px solid #e2e8f0 !important;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.1) !important;
        z-index: 3010 !important; display: flex !important; gap: 10px !important; margin: 0 !important;
    }
    /* Esconde barra de ações se o carro estiver vendido */
    #modal-actions.hidden { display: none !important; }

    /* Botão Fechar Modal */
    .btn-close-modal {
        width: 42px; height: 42px; border-radius: 50%; border: none;
        background-color: #f1f5f9; color: #64748b;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.25rem; cursor: pointer; margin-right: -10px; margin-top: -5px; flex-shrink: 0;
    }
    /* --- ESTILOS DO CONTRATO (NOVO) --- */

/* Simulação de Folha A4 na tela */
.paper-a4 {
    background: white;
    width: 210mm; /* Largura A4 */
    min-height: 297mm; /* Altura A4 */
    padding: 20mm;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    color: #000;
    font-family: 'Times New Roman', Times, serif;
    font-size: 12pt;
    line-height: 1.5;
    overflow-y: visible;
    outline: none; /* Remove borda azul ao editar */
}

/* Header do Contrato com Logo */
.contract-header-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.contract-logo-img {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
}

.contract-agency-info {
    text-align: right;
    font-size: 10pt;
}

.contract-title {
    text-align: center;
    font-weight: bold;
    font-size: 16pt;
    margin: 20px 0;
    text-transform: uppercase;
    text-decoration: underline;
}

.contract-section-title {
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-size: 11pt;
}

.contract-text {
    margin-bottom: 10px;
    text-align: justify;
}

.contract-signature-area {
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.signature-line {
    flex: 1;
    border-top: 1px solid #000;
    margin-top: 40px;
    padding-top: 5px;
    text-align: center;
    font-size: 10pt;
}

/* Responsividade para telas pequenas (apenas visualização) */
@media (max-width: 768px) {
    .paper-a4 {
        width: 100%;
        min-height: auto;
        padding: 15px;
        font-size: 10pt;
    }
    .contract-signature-area {
        flex-direction: column;
        gap: 40px;
    }
}


/* --- CSS DE IMPRESSÃO PROFISSIONAL E LIMPO (V3) --- */
@media print {
    /* 1. CONFIGURAÇÃO DA PÁGINA (Remove data, hora e links do navegador) */
    @page {
        margin: 0; /* Remove margens do navegador */
        size: A4;  /* Força tamanho A4 */
    }

    /* 2. RESET GERAL */
    body, html {
        margin: 0;
        padding: 0;
        background: white;
        height: auto;
        overflow: visible !important; /* Mata o scroll */
    }

    /* Esconde tudo que não é o contrato */
    body > * {
        display: none !important;
    }

    /* 3. CONFIGURAÇÃO DO MODAL PARA PAPEL */
    #modal-contrato {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        z-index: 99999 !important;
        overflow: visible !important; /* Crucial para não ter scrollbar na impressão */
    }

    /* Esconde elementos de interface do modal */
    .modal-header, 
    .btn, 
    .badge,
    .text-muted,
    .contract-loading,
    ::-webkit-scrollbar { /* Força ocultação da scrollbar */
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    /* 4. O PAPEL (Área impressa) */
    .modal-body.contract-backdrop {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }

    .paper-a4 {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        width: 100% !important;
        
        /* Margens internas seguras para impressão (Top, Right, Bottom, Left) */
        padding: 1.5cm 2cm 1.5cm 2cm !important; 
        
        font-family: "Times New Roman", Times, serif !important;
        color: #000 !important;
        font-size: 11pt !important; /* Reduzi levemente para caber tudo */
        line-height: 1.3 !important; /* Compacta levemente as linhas */
        text-align: justify !important;
    }

    /* 5. AJUSTES DE ESPAÇAMENTO (Tira os buracos brancos) */
    .contract-header-layout {
        border-bottom: 2px solid #000 !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .contract-logo-img {
        max-height: 60px !important; /* Limita altura do logo */
        width: auto !important;
    }

    .contract-title {
        font-size: 14pt !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        text-align: center !important;
        margin: 20px 0 !important;
        text-decoration: underline !important;
    }

    .contract-section-title {
        font-size: 11pt !important;
        font-weight: bold !important;
        margin-top: 15px !important;
        margin-bottom: 5px !important;
        text-transform: uppercase !important;
        background-color: #f3f3f3 !important; /* Fundo cinza suave no título da seção fica elegante */
        padding: 2px 5px !important;
       
    }

    .contract-text {
        margin-bottom: 10px !important;
    }

    /* 6. ASSINATURAS */
    .contract-signature-area {
        display: flex !important;
        justify-content: space-between !important;
        margin-top: 50px !important; /* Espaço para assinar */
        page-break-inside: avoid !important; /* Evita quebrar para a próxima folha */
    }

    .signature-line {
        flex: 0 0 45% !important;
        border-top: 1px solid #000 !important;
        padding-top: 5px !important;
        text-align: center !important;
        font-size: 10pt !important;
    }
}

/* --- CSS MOBILE FINAL (v11 - Tech Border Beam + Lista Clássica) --- */
@media (max-width: 768px) {

    /* --- PARTE 1: ESTRUTURA GERAL --- */
    #view-dashboard:not(.hidden) {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important; padding: 5px !important;
    }
    #view-dashboard.hidden { display: none !important; }

    /* Desfaz containers antigos */
    .kpi-grid, .kpi-grid-4-col, .kpi-grid-3-col { display: contents !important; }

    /* Estilo Base dos Cards (Quadrados) */
    .kpi-card {
        background: #ffffff !important;
        border-radius: 20px !important;
        padding: 15px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important; /* Sombra mais leve e difusa (Google Style) */
        border: 1px solid rgba(0,0,0,0.03) !important;
        min-height: 120px !important;
        display: flex !important; flex-direction: column !important; justify-content: space-between !important;
        position: relative !important; overflow: hidden !important;
    }
    .kpi-card .kpi-label {
        font-size: 0.7rem !important; font-weight: 700 !important; color: #94a3b8 !important;
        text-transform: uppercase; margin-top: auto !important; z-index: 5 !important; letter-spacing: 0.5px;
    }
    .kpi-card .kpi-value {
        font-size: 1.6rem !important; font-weight: 800 !important; color: #1e293b !important;
        z-index: 5 !important; line-height: 1.1 !important;
    }
    .kpi-card .kpi-icon-wrapper {
        width: 40px !important; height: 40px !important; font-size: 1.2rem !important; z-index: 5 !important;
        border-radius: 12px !important; display: flex !important; align-items: center !important; 
        justify-content: center !important; margin-bottom: 10px !important;
    }

    /* --- PARTE 2: O CARD DE LUCRO (TECH BORDER BEAM) --- */
    .kpi-grid-4-col .card:nth-child(1) {
        order: 1 !important; grid-column: span 2 !important;
        min-height: 150px !important; border: none !important;
        
        display: flex !important; align-items: center !important; justify-content: center !important;
        text-align: center !important;
        
        position: relative !important; 
        overflow: hidden !important; 
        
        /* Fundo transparente para ver o efeito atrás */
        background: transparent !important; 
        z-index: 1 !important;
        border-radius: 24px !important; /* Cantos maiores estilo Apple/Google */
    }

    /* CAMADA 1: O "Radar" que gira (Fundo animado) */
    .kpi-grid-4-col .card:nth-child(1)::before {
        content: '' !important; position: absolute !important;
        top: 50% !important; left: 50% !important;
        width: 150% !important; height: 300% !important;
        
        /* O Gradiente Tecnológico: Transparente -> Cyan Neon -> Branco */
        background: conic-gradient(
            transparent 75%, 
            #2563eb 93%, /* Cyan (Info color) */
            #ffffff 100%
        ) !important;
        
        animation: border-spin 2s linear infinite !important; /* Gira suavemente */
        z-index: -2 !important;
    }

    /* CAMADA 2: O Miolo do Card (Cobre o centro, deixando 2px de borda) */
    .kpi-grid-4-col .card:nth-child(1)::after {
        content: '' !important; position: absolute !important;
        inset: 2px !important; /* Espessura da borda de luz */
        background: linear-gradient(135deg, #2563eb 0%, #172554 100%) !important; /* Azul Profundo Tech */
        border-radius: 22px !important;
        z-index: -1 !important;
    }

    /* Textos do Lucro */
    .kpi-grid-4-col .card:nth-child(1) .kpi-label { color: rgba(255,255,255,0.7) !important; margin: 0 0 5px 0 !important; z-index: 10 !important; letter-spacing: 2px !important; font-size: 0.75rem !important;}
    .kpi-grid-4-col .card:nth-child(1) .kpi-value { color: white !important; font-size: 2.6rem !important; z-index: 10 !important; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
    .kpi-grid-4-col .card:nth-child(1) .kpi-icon-wrapper { display: none !important; }


    /* --- PARTE 3: OUTROS CARDS (Estilo Clean) --- */
    
    /* Pátio */
    .kpi-grid-4-col .card:nth-child(2) { order: 2 !important; }
    
    /* Vendidos (Ao lado do Pátio) */
    .kpi-grid-3-col .card:nth-child(3) {
        order: 3 !important; display: flex !important; flex-direction: column !important;
        min-height: 120px !important; width: auto !important;
    }
    .kpi-grid-3-col .card:nth-child(3) .kpi-icon-wrapper { background: #ecfdf5 !important; color: #059669 !important; margin-right: 0 !important; }

    /* Capital Empenhado (Embaixo, Largo) */
    .kpi-grid-4-col .card:nth-child(3) {
        order: 4 !important; grid-column: span 2 !important;
        flex-direction: row !important; align-items: center !important; min-height: 80px !important;
    }
    .kpi-grid-4-col .card:nth-child(3) .kpi-icon-wrapper { margin-bottom: 0 !important; margin-right: 15px !important; }
    .kpi-grid-4-col .card:nth-child(3) .kpi-label { margin-top: 0 !important; }
    .kpi-grid-4-col .card:nth-child(3) .kpi-value { margin-left: auto !important; }

    /* Marca d'água sutil (Estilo Google) */
    .kpi-grid-4-col .card:nth-child(2)::after, 
    .kpi-grid-3-col .card:nth-child(3)::after {
        content: ''; position: absolute; top: -10px; right: -10px;
        font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 4rem; 
        color: #e1f3ff; transform: rotate(10deg); z-index: 1; pointer-events: none;
    }
    .kpi-grid-4-col .card:nth-child(2)::after { content: '\f1b9'; }
    .kpi-grid-3-col .card:nth-child(3)::after { content: '\f2b5'; }

    /* Ocultar não usados */
    .kpi-grid-4-col .card:nth-child(4), .kpi-grid-3-col .card:nth-child(1), .kpi-grid-3-col .card:nth-child(2) { display: none !important; }


    /* --- PARTE 4: LISTA DE VENDAS (ESTILO CLÁSSICO RESTAURADO) --- */
    #view-dashboard > .card:last-child {
        order: 5 !important; grid-column: span 2 !important;
        background: white !important; box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
        border: 1px solid rgba(0,0,0,0.03) !important; padding: 20px !important;
        margin-top: 10px !important; border-radius: 20px !important; display: block !important;
    }
    #view-dashboard .card-title {
        font-size: 1rem !important; color: #1e293b !important; font-weight: 700 !important;
        margin-bottom: 15px !important; padding-left: 0 !important;
    }
    
    /* Estrutura de Lista Simples */
    #tabela-vendas-dash, #tabela-vendas-dash tbody, #tabela-vendas-dash tr, #tabela-vendas-dash td { display: block !important; }
    
    #tabela-vendas-dash tr {
        background: transparent !important; box-shadow: none !important; border: none !important;
        border-radius: 0 !important; padding: 15px 0 !important; border-bottom: 1px solid #e2e8f0 !important;
    }
    #tabela-vendas-dash tr:last-child { border-bottom: none !important; }
    
    #tabela-vendas-dash td:nth-child(1) { /* Nome Veículo */
        font-weight: 700; color: #1e293b; font-size: 0.95rem; margin-bottom: 8px !important; text-align: left !important;
    }
    #tabela-vendas-dash td:nth-child(1) small { /* Placa */
        display: block !important; font-weight: 400; color: #94a3b8; font-size: 0.8rem; margin-top: 2px !important;
    }
    
    /* Linhas de Dados (Valor, Lucro, Data) */
    #tabela-vendas-dash td:nth-child(2), #tabela-vendas-dash td:nth-child(3), #tabela-vendas-dash td:nth-child(4) {
        display: flex !important; justify-content: space-between !important; width: 100% !important;
        padding: 4px 0 !important; font-size: 0.9rem !important; color: #64748b; text-align: right !important;
        background: transparent !important;
    }
    #tabela-vendas-dash td:nth-child(2)::before { content: 'Valor Venda:'; font-weight: 400; color: #64748b; }
    #tabela-vendas-dash td:nth-child(2) { color: #1e293b !important; }
    
    #tabela-vendas-dash td:nth-child(3)::before { content: 'Lucro:'; font-weight: 400; color: #64748b; }
    #tabela-vendas-dash td:nth-child(3) { font-weight: 700 !important; } 
    
    #tabela-vendas-dash td:nth-child(4)::before { content: 'Data/Hora:'; font-weight: 400; color: #64748b; }
    #tabela-vendas-dash td:nth-child(4) { font-size: 0.85rem !important; color: #1e293b !important; }
}

/* --- GALERIA E UPLOAD MÚLTIPLO --- */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    transition: 0.2s;
    cursor: pointer;
    margin-bottom: 15px;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}

/* Grid de Preview no Cadastro e Modal */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Quadrado perfeito */
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .btn-remove-photo {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* Botão de Compartilhar */
.btn-share {
    background: #25D366; /* Verde WhatsApp */
    color: white;
    border: none;
    width: 100%;
    margin-top: 10px;
}
.btn-share:hover { background: #128C7E; }

.share-link-box {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    word-break: break-all;
    margin-top: 10px;
    border: 1px dashed #cbd5e1;
    display: none; /* Inicia oculto */
}

@media (max-width: 768px) {
    /* ... seus outros estilos mobile ... */

    /* OCULTAR O DIAMANTE DO HEADER NO MOBILE */
    #btn-assinatura {
        display: none !important;
    }

    /* Ajuste visual para o ícone de plano na barra inferior */
    #bottom-nav-assinatura i {
        color: #f59e0b; /* Cor Dourada/Ambar */
    }
    #bottom-nav-assinatura.active span {
        color: #f59e0b;
        font-weight: 700;
    }
}


}


