/* ==============================================================================
   DNA AUTO — COMPONENTES DE INTERFACE (ERP HIGH-END)
   ============================================================================== */

/* Grid e Layouts de Cards */
.grid-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: var(--transition-fast);
}

.kpi-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card.accent-primary::before { background: var(--brand-primary); }
.kpi-card.accent-success::before { background: var(--proof-level-4); }
.kpi-card.accent-warning::before { background: var(--proof-level-1); }
.kpi-card.accent-cyan::before { background: var(--brand-cyan); }

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    font-size: 18px;
    color: var(--text-dim);
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-highlight);
    font-family: var(--font-mono);
    line-height: 1.1;
}

.kpi-footer {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Painéis e Caixas de Conteúdo */
.panel-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-highlight);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Botões do Sistema */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    outline: none;
    user-select: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: #05080D;
    font-weight: 800;
    box-shadow: 0 3px 12px var(--brand-glow);
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 6px 20px var(--brand-glow);
    transform: translateY(-1px);
}

.btn-cyan, .btn-gold {
    background: var(--brand-primary);
    color: #05080D;
    font-weight: 800;
    box-shadow: 0 2px 10px var(--brand-glow);
}

.btn-cyan:hover, .btn-gold:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 4px 18px var(--brand-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--proof-level-4);
    color: #0b0f19;
    font-weight: 700;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-highlight);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    color: var(--text-highlight);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 700;
}

/* Badges e Selos de Comprovação (Itens 12 e 13) */
.badge-proof {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-level-4, .badge-proven {
    background: var(--proof-level-4-bg);
    color: var(--proof-level-4);
    border: 1px solid var(--proof-level-4-border);
}

.badge-level-3, .badge-confirmed {
    background: var(--proof-level-3-bg);
    color: var(--proof-level-3);
    border: 1px solid var(--proof-level-3-border);
}

.badge-level-2, .badge-documented {
    background: var(--proof-level-2-bg);
    color: var(--proof-level-2);
    border: 1px solid var(--proof-level-2-border);
}

.badge-level-1, .badge-declared {
    background: var(--proof-level-1-bg);
    color: var(--proof-level-1);
    border: 1px solid var(--proof-level-1-border);
}

.badge-rejected {
    background: var(--status-rejected-bg);
    color: var(--status-rejected);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-dna {
    background: rgba(0, 212, 255, 0.15);
    color: var(--brand-cyan);
    border: 1px solid rgba(0, 212, 255, 0.4);
    font-family: var(--font-mono);
}

/* Tabelas Padrão ERP Responsivas */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    position: relative;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    scrollbar-width: thin;
    margin-bottom: 14px;
}

.erp-table {
    width: 100%;
    min-width: 680px; /* Garante que 6-7 colunas nunca sejam espremidas em telas pequenas */
    border-collapse: collapse;
    text-align: left;
}

.erp-table th {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.erp-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 13px;
    white-space: nowrap;
}

/* Colunas descritivas podem quebrar linha com conforto */
.erp-table td:nth-child(3),
.erp-table td.cell-wrap {
    white-space: normal;
    min-width: 220px;
    max-width: 320px;
}

.erp-table tr:hover td {
    background: var(--bg-surface-elevated);
}

.erp-table .mono {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Tabela Encurtada Ajustada para Tablets (Zero Scroll Lateral) */
.table-responsive-tablet-fit {
    width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

.erp-table-tablet-fit {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse;
}

.erp-table-tablet-fit th,
.erp-table-tablet-fit td {
    white-space: normal !important;
    word-break: break-word;
    box-sizing: border-box;
}

/* Formulários */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-control {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

/* Modais do Sistema */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-container.wide {
    max-width: 960px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-highlight);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Alertas e Callouts */
.alert-box {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
}

.alert-warning {
    background: var(--proof-level-1-bg);
    border: 1px solid var(--proof-level-1-border);
    color: #fbbf24;
}

.alert-info {
    background: rgba(0, 136, 255, 0.12);
    border: 1px solid rgba(0, 136, 255, 0.35);
    color: #60a5fa;
}

.alert-success {
    background: var(--proof-level-4-bg);
    border: 1px solid var(--proof-level-4-border);
    color: #34d399;
}

/* ==============================================================================
   DOCUMENTO OFICIAL: RELATÓRIO PARA VENDA & LAUDOS IMPRIMÍVEIS
   ============================================================================== */
.sale-report-document {
    background: #ffffff;
    color: #111827;
    padding: 32px;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sale-report-document * {
    max-width: 100%;
    box-sizing: border-box;
}

.sale-report-document table {
    max-width: none;
}

.report-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #111827;
    padding-bottom: 16px;
    margin-bottom: 20px;
    gap: 16px;
}

.report-header-text {
    flex: 1;
    min-width: 0;
}

.report-certified-badge {
    display: inline-block;
    background: #0088ff;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-title {
    font-size: 24px;
    font-weight: 900;
    color: #111827;
    margin: 6px 0 2px;
    line-height: 1.2;
}

.report-subtitle {
    font-size: 12px;
    color: #4b5563;
    margin: 0;
}

.report-meta {
    font-size: 11px;
    color: #6b7280;
    margin: 4px 0 0;
}

.report-qr-box {
    text-align: center;
    flex-shrink: 0;
}

.report-qr-svg-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.report-qr-svg-wrapper svg {
    max-width: 120px;
    height: auto;
    display: block;
}

.report-qr-code-txt {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-top: 4px;
}

.report-qr-sub {
    font-size: 9px;
    color: #6b7280;
}

.report-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.report-table-scroll table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
    font-size: 12px;
}

/* ==============================================================================
/* Toolbar de Busca e Recepção de Veículos na Oficina */
.ws-search-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.ws-search-input {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    height: 42px;
}
.ws-search-actions {
    display: flex;
    gap: 8px;
}
.ws-btn-search {
    padding: 0 20px;
    font-weight: 700;
    height: 42px;
    white-space: nowrap;
}
.ws-btn-api {
    padding: 0 18px;
    font-weight: 700;
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #05080D;
    height: 42px;
    white-space: nowrap;
}

/* Grids utilitários de formulários */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.form-grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.part-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 34px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.part-delete-btn {
    background: transparent;
    border: none;
    color: var(--status-rejected);
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.part-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ==============================================================================
   RESPONSIVIDADE GERAL DE COMPONENTES NO MOBILE (MAX-WIDTH: 768PX)
   ============================================================================== */
@media (max-width: 768px) {
    .grid-kpi {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 14px !important;
    }

    .kpi-card {
        padding: 12px 10px !important;
    }

    .kpi-title {
        font-size: 10px !important;
    }

    .kpi-value {
        font-size: 22px !important;
    }

    .kpi-footer {
        font-size: 9.5px !important;
        line-height: 1.2;
    }

    .ws-search-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .ws-search-input {
        width: 100%;
        height: 40px;
        font-size: 14px;
    }

    .ws-search-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }

    .ws-btn-search, .ws-btn-api {
        width: 100%;
        height: 36px;
        font-size: 11px;
        padding: 0 6px;
        justify-content: center;
    }

    .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .part-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        background: var(--bg-surface-elevated) !important;
        padding: 10px !important;
        border-radius: var(--radius-sm) !important;
        border: 1px solid var(--border-subtle) !important;
    }

    .part-row .part-name {
        grid-column: 1 / -1 !important;
    }

    .part-row .part-delete-btn {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        justify-content: flex-end !important;
        height: auto !important;
        padding-top: 4px !important;
    }

    .panel-box {
        padding: 14px 10px !important;
        margin-bottom: 14px !important;
        border-radius: var(--radius-md) !important;
    }

    .panel-title {
        font-size: 14px !important;
        margin-bottom: 12px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* Modal no celular ocupa quase toda a tela sem vazar */
    .modal-overlay {
        padding: 6px !important;
    }

    .modal-container {
        max-width: 100% !important;
        max-height: 98vh !important;
        border-radius: var(--radius-md) !important;
    }

    .modal-header {
        padding: 12px 14px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .modal-header h3 {
        font-size: 15px !important;
    }

    .modal-body {
        padding: 12px 8px !important;
    }

    .modal-footer {
        padding: 10px 14px !important;
        flex-direction: column !important;
    }

    .modal-footer .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Documento Oficial de Venda perfeitamente ajustado no celular */
    .sale-report-document {
        padding: 14px 10px !important;
        border-radius: 6px !important;
        overflow-x: hidden !important;
    }

    .report-header-flex {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 14px !important;
    }

    .report-header-text {
        text-align: center !important;
    }

    .report-title {
        font-size: 19px !important;
    }

    .report-qr-box {
        margin: 0 auto !important;
        background: #f8fafc !important;
        padding: 10px 16px !important;
        border-radius: 8px !important;
        border: 1px solid #e2e8f0 !important;
    }

    .report-qr-svg-wrapper svg {
        max-width: 100px !important;
        max-height: 100px !important;
    }

    .report-table-scroll table {
        min-width: 500px !important;
    }

    /* Dica visual de rolagem suave nas tabelas ERP */
    .table-responsive::after {
        content: '👉 Arraste horizontalmente para ver todas as colunas';
        display: block;
        font-size: 10px;
        color: var(--brand-cyan);
        background: rgba(0, 212, 255, 0.08);
        padding: 5px 10px;
        text-align: center;
        border-top: 1px dashed rgba(0, 212, 255, 0.2);
        font-weight: 600;
        letter-spacing: 0.3px;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}

/* ==============================================================================
   FICHA DE CADASTRO DE VEÍCULO (TELA CENTRALIZADA COM BUSCA DE PLACA & API)
   ============================================================================== */
.owner-empty-garage-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 20px 12px;
    width: 100%;
    box-sizing: border-box;
}

.owner-plate-register-card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(11, 15, 25, 0.98));
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 660px;
    padding: 32px 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.owner-plate-register-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-cyan));
}

.owner-plate-header {
    text-align: center;
    margin-bottom: 22px;
}

.owner-plate-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 210, 28, 0.12);
    border: 1px solid rgba(255, 210, 28, 0.35);
    color: var(--brand-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.owner-plate-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
    letter-spacing: -0.4px;
}

.owner-plate-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Banner de Integração de API Pronta */
.plate-api-ready-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(0, 212, 255, 0.07);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 22px;
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.5;
}

.plate-api-ready-banner strong {
    color: var(--brand-cyan);
}

/* Card Visual de Placa Mercosul Centralizado */
.mercosul-plate-box {
    max-width: 360px;
    margin: 0 auto 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 3px solid #1e293b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.mercosul-header-stripe {
    background: #003399;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    font-family: var(--font-sans);
}

.mercosul-input-row {
    padding: 4px 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mercosul-input-field {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #05080D;
    text-transform: uppercase;
}

.mercosul-input-field::placeholder {
    color: #94a3b8;
    letter-spacing: 3px;
    font-weight: 700;
}

/* Ficha de Cadastro Revelada */
.plate-dossier-form {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
    animation: authFadeIn 0.3s ease-out;
}

.plate-found-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .owner-plate-register-card {
        padding: 20px 14px;
    }
    .mercosul-input-field {
        font-size: 26px;
        letter-spacing: 2px;
    }
}

/* ==============================================================================
   ESTILOS DAS ABAS DO PAINEL ADMINISTRATIVO (MULTI-TENANT ERP)
   ============================================================================== */
.admin-tabs-bar {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-tab-btn {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.admin-tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.04);
}

.admin-tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.admin-tab-count {
    font-size: 10.5px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 6px;
    border-radius: 10px;
    font-family: var(--font-mono);
}

.admin-tab-btn.active .admin-tab-count {
    color: #FFD21C;
    background: rgba(255, 210, 28, 0.12);
}

/* ==============================================================================
   ESTILOS HIERÁRQUICOS: OFICINAS ➔ CARROS POR OFICINA (DISCRETO & PROFISSIONAL)
   ============================================================================== */
.workshop-tree-card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.workshop-tree-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.workshop-tree-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ws-tree-title-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ws-tree-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #94a3b8;
}

.ws-tree-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-tree-meta {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

.ws-tree-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
}

.ws-stat-pill {
    color: #94a3b8;
}

.ws-stat-pill strong {
    color: #ffffff;
}

.workshop-tree-body {
    padding: 0;
}

.ws-car-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s;
}

.ws-car-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.ws-car-row:last-child {
    border-bottom: none;
}

/* ============================================================================== */
/* PLATAFORMA ERP OFICINA (ESTILO TOTVS CORPORATIVO)                              */
/* ============================================================================== */
.ws-erp-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.ws-erp-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ws-erp-header-title h2 {
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
    margin: 4px 0 2px;
    letter-spacing: -0.3px;
}

.ws-erp-header-title p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0;
}

.ws-erp-body {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 960px) {
    .ws-erp-body {
        grid-template-columns: 1fr;
    }
}

/* Sub-Menu Lateral da Oficina */
.ws-erp-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 960px) {
    .ws-erp-sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 6px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

.ws-erp-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    user-select: none;
}

.ws-erp-nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.ws-erp-nav-item.active {
    color: #05080d;
    background: #FFD21C;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(255, 210, 28, 0.25);
}

.ws-erp-nav-item.active svg {
    stroke: #05080d;
}

.ws-erp-nav-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ws-erp-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    font-weight: 700;
}

.ws-erp-nav-item.active .ws-erp-badge {
    background: rgba(0, 0, 0, 0.2);
    color: #05080d;
}

.ws-erp-badge.alert-pulse {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    animation: wsPulseBadge 2s infinite;
}

.ws-erp-nav-item.active .ws-erp-badge.alert-pulse {
    background: #dc2626;
    color: #ffffff;
}

@keyframes wsPulseBadge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ws-erp-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Barra de Pesquisa com 2 Botões */
.ws-search-dual-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ws-btn-cadastrar-carro {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    padding: 0 16px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: filter 0.15s ease;
}

.ws-btn-cadastrar-carro:hover {
    filter: brightness(1.1);
}

/* Alerta de Entrada Imediata OBD2 */
.ws-entry-alert-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
}

.ws-entry-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f87171;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.ws-entry-alert-body {
    font-size: 12.5px;
    color: var(--text-main);
    line-height: 1.5;
}

/* Tabela de Alertas de Manutenção Preventiva */
.ws-alert-row-critical {
    background: rgba(239, 68, 68, 0.04);
}
.ws-alert-row-warning {
    background: rgba(245, 158, 11, 0.04);
}

/* ==============================================================================
   DNA AUTO ERP — PAINEL OPERACIONAL DA OFICINA & AUTO CENTER (ALTO PADRÃO)
   ============================================================================== */

/* 1. Isolamento de Tela Cheia do Painel ERP */
body.is-workshop-erp {
    overflow: hidden !important;
}

body.is-workshop-erp #app-container {
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
}

body.is-workshop-erp #app-container > .top-navbar,
body.is-workshop-erp #app-container > .main-layout > .sidebar,
body.is-workshop-erp #app-container > .main-layout > #sidebar-backdrop {
    display: none !important;
}

body.is-workshop-erp #app-container > .main-layout {
    height: 100% !important;
    min-height: 100% !important;
}

body.is-workshop-erp #app-container > .main-layout > #view-content {
    padding: 0 !important;
    overflow: hidden !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* 1.1 Isolamento de Tela Cheia do App do Proprietário (Regra de Arquitetura) */
body.is-owner-app {
    overflow-x: hidden !important;
    background: #050B14 !important;
}

body.is-owner-app #app-container {
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
}

body.is-owner-app #app-container > .top-navbar,
body.is-owner-app #app-container > .main-layout > .sidebar,
body.is-owner-app #app-container > .main-layout > #sidebar-backdrop {
    display: none !important;
}

body.is-owner-app #app-container > .main-layout {
    height: 100% !important;
    min-height: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.is-owner-app #app-container > .main-layout > #view-content {
    padding: 0 !important;
    overflow-y: auto !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* 2. Container Root do ERP da Oficina */
.ws-erp-viewport {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 100vw;
    background: #080c14;
    color: #e2e8f0;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

/* 3. Header Corporativo Superior */
.ws-erp-header-bar {
    height: 58px;
    min-height: 58px;
    background: #0d131f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    gap: 12px;
    z-index: 100;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
}

.ws-erp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ws-erp-hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #FFD21C;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    transition: all 0.15s ease;
}

.ws-erp-hamburger-btn:hover {
    background: rgba(255, 210, 28, 0.12);
    border-color: #FFD21C;
}

.ws-erp-brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.ws-erp-brand-block h1 {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin: 0;
    line-height: 1.1;
}

.ws-erp-brand-block p {
    font-size: 9.5px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0;
    font-weight: 600;
}

.ws-erp-network-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ws-erp-network-status .dot-live {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: wsPulseBadge 2s infinite;
}

.ws-erp-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ws-erp-ws-title {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 4px;
}

.ws-erp-ws-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
}

.ws-erp-ws-sub {
    font-size: 10.5px;
    color: #64748b;
    white-space: nowrap;
}

/* Botão de Notificações */
.ws-erp-bell-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ws-erp-bell-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 210, 28, 0.3);
}

.ws-erp-bell-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid #0d131f;
    line-height: 1.2;
}

/* Popover de Notificações */
.ws-notifications-dropdown {
    position: absolute;
    top: 54px;
    right: 18px;
    width: 320px;
    max-width: calc(100vw - 28px);
    background: #0f172a;
    border: 1px solid rgba(255, 210, 28, 0.3);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow: hidden;
    animation: wsFadeIn 0.15s ease-out;
}

.ws-notif-header {
    padding: 12px 14px;
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ws-notif-item {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.ws-notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Usuário e Logout */
.ws-erp-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
}

.ws-erp-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd21c, #f59e0b);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

.ws-erp-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.ws-erp-logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    border-color: #ef4444;
}

/* 4. Corpo Principal com Sidebar e Conteúdo */
.ws-erp-main-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
    position: relative;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* 5. Sidebar Desktop & Drawer Mobile */
.ws-erp-sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    background: #090e18;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    user-select: none;
    flex-shrink: 0;
    z-index: 90;
    box-sizing: border-box;
}

.ws-erp-sidebar-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.25);
}

.ws-erp-sidebar-header .title-main {
    font-size: 13px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.ws-erp-sidebar-header .title-sub {
    font-size: 9.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 2px;
}

/* Accordion de Módulos */
.ws-erp-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.ws-erp-accordion-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ws-erp-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ws-erp-group-header:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #f1f5f9;
}

.ws-erp-group-header .group-title-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.ws-erp-group-header .arrow-icon {
    font-size: 10px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.ws-erp-accordion-group.open .arrow-icon {
    transform: rotate(180deg);
    color: #FFD21C;
}

.ws-erp-accordion-items {
    display: none;
    list-style: none;
    margin: 0;
    padding: 2px 0 6px;
}

.ws-erp-accordion-group.open .ws-erp-accordion-items {
    display: block;
}

.ws-erp-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.15s ease;
}

.ws-erp-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.ws-erp-menu-item.active {
    background: #0066FF !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35);
}

.ws-erp-menu-item.active span,
.ws-erp-menu-item.active .badge-proof {
    color: #ffffff !important;
}

.ws-erp-menu-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ws-erp-menu-left span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 6. Área de Conteúdo Central */
.ws-erp-content-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 28px 80px;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

/* 7. Topbar do Dashboard (Blueprint Oficial) */
.ws-dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.ws-dash-title {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.4px;
    margin: 0;
}

.ws-dash-search-container {
    flex: 1;
    max-width: 440px;
    min-width: 280px;
}

.ws-dash-search-box {
    display: flex;
    align-items: center;
    background: #0d172e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 4px 6px 4px 14px;
    transition: all 0.2s ease;
}

.ws-dash-search-box:focus-within {
    border-color: #0066FF;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.25);
    background: #0f1c38;
}

.ws-dash-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13px;
    padding: 6px 8px;
}

.ws-dash-search-input::placeholder {
    color: #64748b;
}

.ws-dash-search-btn {
    background: #0066FF;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.ws-dash-search-btn:hover {
    background: #0052cc;
}

/* 8. Resumo Operacional (6 KPIs no Grid 3x2) */
.ws-dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .ws-dash-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .ws-dash-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 16px;
    }

    .ws-dash-title {
        font-size: 20px;
    }

    .ws-dash-search-container {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .ws-dash-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }

    .ws-dash-kpi-card {
        padding: 10px 12px;
        min-height: 80px;
    }

    .ws-dash-kpi-label {
        font-size: 11px;
    }

    .ws-dash-kpi-value {
        font-size: 17px;
    }

    .ws-dash-kpi-subtext {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.ws-dash-kpi-card {
    background: #0d172e;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 105px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ws-dash-kpi-card:hover {
    border-color: rgba(0, 102, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ws-dash-kpi-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.ws-dash-kpi-value-row {
    margin: 8px 0 4px;
}

.ws-dash-kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.ws-dash-trend-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #10b981;
}

.ws-dash-kpi-subtext {
    font-size: 11.5px;
    color: #64748b;
}

.text-danger {
    color: #ef4444 !important;
}

/* 9. Ações Rápidas (Grid 3 Colunas) */
.ws-dash-section-header {
    margin: 24px 0 12px;
}

.ws-dash-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #cbd5e1;
    margin: 0;
}

.ws-dash-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .ws-dash-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ws-dash-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 18px;
    }

    .ws-dash-action-btn {
        padding: 10px 12px;
        font-size: 11.5px;
        gap: 6px;
    }
}

.ws-dash-action-btn {
    background: #111c38;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 13px 18px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.ws-dash-action-btn:hover {
    background: #162447;
    border-color: rgba(0, 102, 255, 0.4);
    color: #ffffff;
    transform: translateY(-1px);
}

.ws-dash-action-btn.primary {
    background: #0066FF;
    border-color: #0066FF;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35);
}

.ws-dash-action-btn.primary:hover {
    background: #0052cc;
    border-color: #0052cc;
}

/* 10. Cards Horizontais da Recepção / Pátio (Screen 2) */
.ws-yard-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ws-yard-card-item {
    background: #0d172e;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.15s ease;
}

@media (max-width: 640px) {
    .ws-yard-card-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }

    .ws-yard-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.ws-yard-card-item:hover {
    border-color: rgba(0, 102, 255, 0.3);
    background: #101c38;
}

.ws-yard-thumb {
    width: 68px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.ws-yard-info-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ws-yard-plate {
    font-family: var(--font-mono, monospace);
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
}

.ws-yard-model {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.ws-yard-sub {
    font-size: 11.5px;
    color: #94a3b8;
}

.ws-yard-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-yard-btn-whatsapp {
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.ws-yard-btn-whatsapp:hover {
    background: #059669;
}

.ws-yard-btn-dossier {
    background: transparent;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ws-yard-btn-dossier:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
}

/* 10. Agendamento em 3 Datas Futuras */
.ws-dates-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 12px;
    margin: 16px 0;
    box-sizing: border-box;
}

.ws-date-card {
    background: #101827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px;
    box-sizing: border-box;
    transition: all 0.15s;
}

.ws-date-card.selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.ws-date-card-header {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
}

.ws-slots-group {
    margin-bottom: 10px;
}

.ws-slots-group-title {
    font-size: 10.5px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
}

.ws-slot-pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 11.5px;
    font-family: var(--font-mono);
    cursor: pointer;
    margin: 2px 4px 2px 0;
    transition: all 0.15s;
}

.ws-slot-pill:hover {
    background: rgba(255, 210, 28, 0.15);
    border-color: #FFD21C;
    color: #FFD21C;
}

.ws-slot-pill.active {
    background: #10b981;
    color: #000000;
    font-weight: 800;
    border-color: #10b981;
}

.ws-slot-pill.busy {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
    background: transparent;
}

/* 11. Cards de Peças no Mobile / Tabela no Desktop */
.ws-parts-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.ws-parts-cards-grid {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 10px;
    box-sizing: border-box;
}

.ws-part-card-box {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    box-sizing: border-box;
}

/* 12. Modais Responsivos do ERP */
.ws-erp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.modal-container,
.ws-erp-modal-window {
    background: #0e1524;
    border: 1px solid rgba(255, 210, 28, 0.35);
    border-radius: 10px;
    width: 100%;
    max-width: min(680px, calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 24px) !important;
    overflow-y: auto !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
    box-sizing: border-box !important;
}

@media (max-width: 600px) {
    .modal-container,
    .ws-erp-modal-window {
        width: calc(100% - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin: 0 auto;
    }
}

.ws-erp-modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #141d2e;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ws-erp-modal-body {
    padding: 18px;
    box-sizing: border-box;
}

/* 13. Responsividade Estrita (320px a 992px) */
.ws-erp-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    z-index: 998;
}

.ws-erp-drawer-backdrop.active {
    display: block;
}

@media (max-width: 992px) {
    .ws-erp-hamburger-btn {
        display: inline-flex;
    }

    .ws-erp-network-status {
        display: none !important;
    }

    .ws-erp-ws-sub {
        display: none !important;
    }

    .ws-erp-sidebar {
        position: fixed;
        left: -290px;
        top: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 999;
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .ws-erp-sidebar.open {
        left: 0;
        box-shadow: 14px 0 45px rgba(0, 0, 0, 0.95);
    }

    .ws-erp-content-viewport {
        padding: 14px 12px 60px;
    }

    .ws-parts-table-wrap {
        display: none;
    }

    .ws-parts-cards-grid {
        display: grid;
    }
}

@media (max-width: 580px) {
    .ws-erp-header-bar {
        padding: 0 10px;
    }

    .ws-erp-ws-title {
        display: none !important;
    }

    .ws-erp-user-pill span {
        display: none !important;
    }

    .ws-erp-user-pill {
        padding: 4px;
        border: none;
        background: transparent;
    }

    .ws-erp-logout-btn span {
        display: none !important;
    }

    .ws-erp-logout-btn {
        padding: 6px;
    }

    .ws-erp-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ws-erp-quick-actions-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes wsFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   14. SEÇÕES CORPORATIVAS DO MENU ERP & ITENS EM BREVE
   ============================================================================== */
.ws-erp-nav-section {
    margin-bottom: 8px;
}

.ws-erp-nav-section-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #64748b;
    padding: 10px 14px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.ws-erp-menu-item.is-coming-soon {
    opacity: 0.52;
    cursor: not-allowed !important;
}

.ws-erp-menu-item.is-coming-soon:hover {
    background: transparent !important;
    border-color: transparent !important;
}

.ws-erp-menu-item.is-coming-soon .item-text {
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.45);
}

.ws-coming-soon-badge {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: auto;
    letter-spacing: 0.4px;
    text-decoration: none !important;
}

/* ==============================================================================
   15. TOUR GUIADO ONBOARDING DO LOJISTA (INTERATIVO)
   ============================================================================== */
.ws-tour-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.82);
    backdrop-filter: blur(3px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wsFadeIn 0.2s ease;
}

.ws-tour-spotlight {
    position: fixed;
    border: 2px solid #FFD21C;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(3, 7, 18, 0.82), 0 0 25px rgba(255, 210, 28, 0.7);
    z-index: 3001;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ws-tour-card {
    position: fixed;
    z-index: 3002;
    background: #0d1527;
    border: 1px solid rgba(255, 210, 28, 0.4);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
    animation: wsFadeIn 0.2s ease;
    box-sizing: border-box;
}

.ws-tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ws-tour-step-badge {
    font-size: 11px;
    font-weight: 800;
    color: #FFD21C;
    background: rgba(255, 210, 28, 0.12);
    border: 1px solid rgba(255, 210, 28, 0.25);
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.ws-tour-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.ws-tour-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #cbd5e1;
    margin-bottom: 18px;
}

.ws-tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
}

.ws-tour-skip-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.ws-tour-skip-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.ws-tour-actions-right {
    display: flex;
    gap: 8px;
}

/* ==============================================================================
   16. CONFIGURAÇÃO DE WHATSAPP OFICIAL & VERIFICAÇÃO OTP
   ============================================================================== */
.ws-phone-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.ws-phone-status-badge.verified {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.ws-phone-status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.ws-otp-box {
    background: #090e17;
    border: 1px dashed rgba(255, 210, 28, 0.4);
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
}

.ws-otp-input {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 6px;
    text-align: center;
    height: 44px;
    width: 180px;
    border-radius: 6px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFD21C;
}

/* ==============================================================================
   14. SINO E NOTIFICAÇÕES NO MENU LATERAL (SIDEBAR)
   ============================================================================== */
.ws-sidebar-notif-box {
    margin: 10px 12px 14px;
    background: #0c121d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    position: relative;
}

.ws-sidebar-notif-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 3px 2px;
    transition: all 0.15s ease;
}

.ws-sidebar-notif-btn:hover {
    filter: brightness(1.2);
}

.ws-sidebar-bell-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ws-sidebar-notif-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 240px;
    background: #0c1320;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85);
    z-index: 999;
    padding: 6px 0;
}

/* ==============================================================================
   15. GRADE SEMANAL DA AGENDA & BLOQUEIO DE ALMOÇO (12H ÀS 13H EM CINZA)
   ============================================================================== */
.ws-agenda-grid-container {
    background: #090e17;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 14px;
}

.ws-agenda-grid-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.ws-agenda-grid-table th {
    background: #0d1522;
    padding: 12px 10px;
    font-size: 11.5px;
    font-weight: 800;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.ws-agenda-grid-table th.active-day {
    color: #FFD21C;
    background: rgba(255, 210, 28, 0.08);
    border-bottom-color: #FFD21C;
}

.ws-agenda-grid-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px;
    vertical-align: top;
    height: 52px;
}

.ws-agenda-hour-cell {
    background: #0b111c;
    color: #94a3b8;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    width: 80px;
    white-space: nowrap;
    border-right: 2px solid rgba(255, 255, 255, 0.08) !important;
}

/* Linha de almoço permanentemente apagada em cinza (Item obrigatório) */
.ws-agenda-lunch-row {
    background: #131b26 !important;
}

.ws-agenda-lunch-cell {
    background: #16202e !important;
    color: #64748b !important;
    border-top: 1px dashed #334155 !important;
    border-bottom: 1px dashed #334155 !important;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    padding: 10px !important;
    opacity: 0.55;
    pointer-events: none !important;
    cursor: not-allowed;
    user-select: none;
}

.ws-slot-pill.lunch-break {
    background: #18202f !important;
    color: #64748b !important;
    border: 1px dashed #475569 !important;
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.ws-agenda-slot-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 44px;
    border-radius: 6px;
    border: 1px dashed rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.04);
    color: #10b981;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 4px;
}

.ws-agenda-slot-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    transform: translateY(-1px);
}

.ws-agenda-slot-booked {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    min-height: 44px;
    background: #0f192b;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 6px;
    padding: 6px;
    box-sizing: border-box;
}

.ws-agenda-slot-disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #475569;
    font-size: 10.5px;
    cursor: pointer;
}

/* ==============================================================================
   16. WHATSAPP IN-PLATFORM (RECIBO DENTRO DA PLATAFORMA)
   ============================================================================== */
.ws-whatsapp-receipt-box {
    background: #09121a;
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 16px;
    margin-top: 14px;
    animation: fadeIn 0.25s ease;
}

/* ==============================================================================
   17. SEPARADORES DE SETORES DO MENU LATERAL (SIDEBAR SETORIZADA)
   ============================================================================== */
.ws-menu-sector {
    margin-bottom: 12px;
}

.ws-menu-sector-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748B;
    padding: 8px 16px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.ws-menu-sector-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin-left: 4px;
}

/* ==============================================================================
   18. HERO BANNER DA RECEPÇÃO & AÇÃO RÁPIDA NA DASHBOARD
   ============================================================================== */
.ws-dash-hero-banner {
    background: linear-gradient(135deg, rgba(13, 27, 62, 0.95) 0%, rgba(8, 16, 32, 0.98) 100%);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.ws-dash-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.ws-dash-hero-title {
    font-size: 18px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-dash-hero-sub {
    font-size: 12.5px;
    color: #94A3B8;
    margin: 0;
}

.ws-dash-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ws-btn-hero-action {
    background: #0066FF;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35);
}

.ws-btn-hero-action:hover {
    background: #0052cc;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 102, 255, 0.45);
}

.ws-btn-hero-action.success {
    background: #10B981;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.ws-btn-hero-action.success:hover {
    background: #059669;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

/* ==============================================================================
   19. RODAPÉ SUTIL DO ERP COM NOME DA OFICINA
   ============================================================================== */
.ws-erp-footer-subtle {
    margin-top: 36px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: #64748B;
    user-select: none;
}

.ws-erp-footer-subtle strong {
    color: #94A3B8;
    font-weight: 600;
}

.ws-erp-footer-subtle .footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10.5px;
}

/* ==============================================================================
   20. RESPONSIVIDADE PARA TABLET DE 10 POLEGADAS (PORTRAIT & LANDSCAPE)
   ============================================================================== */

/* TABLET 10" EM PÉ (PORTRAIT: ~768px a 992px) */
@media screen and (min-width: 768px) and (max-width: 992px) {
    .ws-erp-layout {
        display: flex;
        flex-direction: column;
    }

    .ws-erp-sidebar {
        width: 100% !important;
        height: auto !important;
        position: relative !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 10px 14px;
        overflow-x: auto;
    }

    .ws-menu-sector {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 0;
        margin-right: 12px;
    }

    .ws-menu-sector-title {
        display: none;
    }

    .ws-erp-content {
        padding: 16px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .ws-dash-hero-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .ws-dash-hero-actions {
        width: 100%;
    }

    .ws-btn-hero-action {
        flex: 1;
        justify-content: center;
    }

    .ws-stats-grid,
    .ws-dash-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .ws-vehicle-card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .ws-modal-card {
        width: 94% !important;
        max-width: 94% !important;
        padding: 18px !important;
    }

    .ws-erp-footer-subtle {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* TABLET 10" DEITADO (LANDSCAPE: ~993px a 1280px) */
@media screen and (min-width: 993px) and (max-width: 1280px) {
    .ws-erp-sidebar {
        width: 230px !important;
        min-width: 230px !important;
    }

    .ws-erp-content {
        padding: 20px !important;
    }

    .ws-stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 14px !important;
    }

    .ws-dash-grid {
        grid-template-columns: 2fr 1.2fr !important;
        gap: 16px !important;
    }

    .ws-dash-hero-banner {
        padding: 18px 20px;
    }

    .ws-modal-card {
        max-width: 580px !important;
    }
}

/* ────────────────────────────────────────────────────────────────────────── */
/* TABELA COMPACTA SEM ROLAGEM HORIZONTAL (OTIMIZADA PARA TABLET E DESKTOP)   */
/* ────────────────────────────────────────────────────────────────────────── */
.table-responsive-tablet-fit {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

.erp-table-tablet-fit {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse;
}

.erp-table-tablet-fit th,
.erp-table-tablet-fit td {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    padding: 10px 8px !important;
    vertical-align: middle !important;
}

@media screen and (max-width: 900px) {
    .erp-table-tablet-fit th,
    .erp-table-tablet-fit td {
        padding: 8px 5px !important;
        font-size: 11px !important;
    }
}


/* ==============================================================================
   CENTRAL DE ATENDIMENTO WHATSAPP — RESPONSIVO PARA TABLET RETRATO & MOBILE
   ============================================================================== */

/* Container principal do chat (2 colunas em desktop, master-detail em tablet) */
.ws-chat-container {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 520px;
    max-height: 760px;
    background: #070c18;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

/* Coluna lateral (lista de conversas) */
.ws-chat-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    background: #090f1d;
    transition: transform 0.25s ease, width 0.25s ease;
}

/* Coluna direita (janela de chat ativa) */
.ws-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #050913;
    min-width: 0;
}

/* Botão Voltar (tablet/mobile, oculto em desktop) */
.ws-chat-back-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.ws-chat-back-btn:hover { background: rgba(255,255,255,0.10); color: #fff; }

/* Balões de mensagem */
.ws-chat-bubble {
    max-width: 78%;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ws-chat-bubble-incoming {
    align-self: flex-start;
    background: #1e293b;
    color: #f8fafc;
    border-radius: 12px 12px 12px 2px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.ws-chat-bubble-outgoing {
    align-self: flex-end;
    background: #065f46;
    color: #ffffff;
    border-radius: 12px 12px 2px 12px;
    border: 1px solid rgba(37,211,102,0.3);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

/* Miniaturas de imagem/vídeo nas mensagens */
.ws-chat-media-thumb {
    width: 100%;
    max-width: 240px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    object-fit: cover;
    max-height: 180px;
    display: block;
}

/* Player de áudio inline */
.ws-chat-audio-player {
    width: 100%;
    max-width: 260px;
    height: 36px;
    border-radius: 8px;
    accent-color: #25D366;
    margin-bottom: 4px;
}

/* Preview do anexo pendente (antes de enviar) */
#ws-chat-media-preview {
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(37,211,102,0.08);
    border: 1px dashed rgba(37,211,102,0.4);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #a7f3d0;
    flex-wrap: wrap;
}
#ws-chat-media-preview.active { display: flex; }

.ws-chat-media-preview-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.ws-chat-media-preview-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ffffff;
    font-weight: 700;
}

.ws-chat-media-preview-cancel {
    background: none;
    border: none;
    color: #f87171;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    line-height: 1;
}

/* Barra de ações de mídia (📷 🎥 🎙️) */
.ws-chat-media-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ws-chat-media-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 14px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}
.ws-chat-media-btn:hover {
    background: rgba(37,211,102,0.15);
    border-color: rgba(37,211,102,0.4);
    color: #25D366;
}
.ws-chat-media-btn.recording {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.6);
    color: #f87171;
    animation: ws-pulse-red 1s ease infinite;
}

@keyframes ws-pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* Abas da sidebar (Conversas / Serviços em Potencial) */
.ws-chat-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: #060a14;
    flex-shrink: 0;
}

.ws-chat-sidebar-tab {
    flex: 1;
    padding: 9px 8px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
}
.ws-chat-sidebar-tab.active {
    color: #25D366;
    border-bottom-color: #25D366;
    background: rgba(37,211,102,0.06);
}
.ws-chat-sidebar-tab:hover:not(.active) {
    color: #94a3b8;
    background: rgba(255,255,255,0.04);
}

/* Card de veículo em potencial na sidebar */
.ws-potential-vehicle-card {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: default;
    transition: background 0.15s;
}
.ws-potential-vehicle-card:hover {
    background: rgba(255,255,255,0.03);
}

/* ── TABLET RETRATO (≤ 900px) ─────────────────────────────────────────── */
@media screen and (max-width: 900px) {
    .ws-chat-container {
        height: calc(100vh - 160px);
        max-height: none;
        min-height: 480px;
        border-radius: 8px;
    }

    /* Em tablet retrato: sidebar e main ficam full-width,
       controlados via classe .ws-mobile-show-chat */
    .ws-chat-sidebar {
        width: 100%;
        border-right: none;
    }

    /* Quando conversa está aberta, esconde sidebar e mostra chat */
    .ws-chat-container.ws-mobile-show-chat .ws-chat-sidebar {
        display: none;
    }
    .ws-chat-container.ws-mobile-show-chat .ws-chat-main {
        display: flex;
    }

    /* Quando nenhuma conversa está aberta, mostra sidebar full width */
    .ws-chat-container:not(.ws-mobile-show-chat) .ws-chat-main {
        display: none;
    }

    .ws-chat-back-btn {
        display: inline-flex;
    }

    .ws-chat-bubble {
        max-width: 90%;
    }

    .ws-chat-media-thumb {
        max-width: 200px;
        max-height: 160px;
    }
}

/* ── MOBILE PEQUENO (≤ 540px) ─────────────────────────────────────────── */
@media screen and (max-width: 540px) {
    .ws-chat-container {
        height: calc(100vh - 140px);
        border-radius: 6px;
    }

    .ws-chat-bubble {
        font-size: 12px;
        max-width: 95%;
        padding: 8px 11px;
    }

    .ws-chat-media-actions .ws-chat-media-btn {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
}

/* ── DNA AI STUDIO: REMOÇÃO DE FUNDO DO VEÍCULO COM IA (ERP OFICINA & CLIENTE) ── */
.dna-ai-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 6px;
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.08);
}

.dna-ai-toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dna-ai-sparkle-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 8px #00D4FF);
    animation: dnaPulseAi 2s infinite ease-in-out;
}

.dna-ai-toggle-title {
    font-size: 12px;
    font-weight: 800;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dna-ai-toggle-title .dna-ai-pill {
    background: linear-gradient(135deg, #00D4FF, #00E676);
    color: #050B14;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 9999px;
    text-transform: uppercase;
}

.dna-ai-toggle-sub {
    font-size: 10.5px;
    color: #94A3B8;
    margin-top: 2px;
}

/* Switcher / Toggle */
.dna-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.dna-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dna-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.16);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dna-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #FFFFFF;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.dna-switch input:checked + .dna-slider {
    background: linear-gradient(135deg, #00D4FF 0%, #00E676 100%);
    border-color: #00E676;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

.dna-switch input:checked + .dna-slider:before {
    transform: translateX(18px);
    background-color: #050B14;
}

/* Overlay de Processamento da IA */
.dna-ai-processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 11, 20, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 20;
    border-radius: 14px;
    animation: dnaFadeIn 0.2s ease-in;
}

.dna-ai-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00D4FF, #00E676, transparent);
    box-shadow: 0 0 12px #00D4FF, 0 0 20px #00E676;
    animation: dnaScanAnimation 2s infinite ease-in-out;
}

@keyframes dnaScanAnimation {
    0% { top: 5%; opacity: 0.3; }
    50% { top: 90%; opacity: 1; }
    100% { top: 5%; opacity: 0.3; }
}

@keyframes dnaPulseAi {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px #00D4FF); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 12px #00E676); }
}

.dna-ai-pulse-badge {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.dna-ai-spinning-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #00D4FF;
    border-right-color: #00E676;
    animation: dnaSpin 1.2s linear infinite;
}

.dna-ai-status-text {
    font-size: 11.5px;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 8px;
    max-width: 260px;
    line-height: 1.3;
}

.dna-ai-progress-bar-wrap {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
    position: relative;
}

.dna-ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00D4FF, #00E676);
    border-radius: 6px;
    transition: width 0.25s ease-out;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

.dna-ai-progress-pct {
    font-size: 10px;
    font-weight: 800;
    color: #00D4FF;
    font-family: monospace;
}

.dna-ai-compare-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #CBD5E1;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.dna-ai-compare-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: #00D4FF;
    color: #FFFFFF;
}

.dna-photo-preview-box {
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: 14px;
    overflow: hidden;
    background: #050B14;
    border: 1px solid rgba(0, 102, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dna-photo-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dna-photo-status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(11, 23, 48, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.35);
    color: #38BDF8;
    font-size: 9.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 5;
}

.dna-photo-upload-zone {
    border: 1.5px dashed rgba(0, 212, 255, 0.4);
    background: rgba(0, 102, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dna-photo-upload-zone:hover {
    background: rgba(0, 102, 255, 0.12);
    border-color: #00D4FF;
}

.dna-photo-preview-box.is-transparent {
    background-color: #070d18;
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%), 
        linear-gradient(-45deg, rgba(255,255,255,0.03) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.03) 75%), 
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.03) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    border-color: rgba(0, 230, 118, 0.4);
    box-shadow: inset 0 0 20px rgba(0, 230, 118, 0.08);
}
