/* ============================================================
   CRM Central do Óleo e Pneus - Estilos Customizados
   ============================================================ */

/* Cores da marca */
:root {
    --co-amarelo: #F5A623;
    --co-preto: #1A1A1A;
    --co-branco: #FFFFFF;
    --co-cinza: #6c757d;
}

/* Header customizado */
.appHeader.bg-dark {
    background-color: var(--co-preto) !important;
}
.appHeader.bg-dark .headerButton ion-icon {
    color: #fff;
    font-size: 26px;
}

/* Garantir que ion-icon sempre renderize com tamanho */
ion-icon {
    min-width: 20px;
    min-height: 20px;
    pointer-events: none;
}

.logo-header {
    max-height: 28px;
    filter: brightness(1.1);
}

/* Bottom menu - botão central */
.appBottomMenu .action-button.large {
    width: 56px;
    height: 56px;
    margin-top: -20px;
}

/* Cards do dashboard */
.card-stat {
    border: none;
    border-radius: 12px;
}

.card-stat .card-body {
    padding: 16px;
}

.card-stat .stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.card-stat .stat-label {
    font-size: 12px;
    color: var(--co-cinza);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Badge de status */
.badge-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* Lista de renovações */
.renovacao-item {
    border-left: 4px solid var(--co-amarelo);
    margin-bottom: 8px;
    border-radius: 8px;
}

.renovacao-item.vencida {
    border-left-color: #dc3545;
}

/* WhatsApp link */
.btn-whatsapp {
    background-color: #25D366;
    color: white;
    border: none;
}

.btn-whatsapp:hover,
.btn-whatsapp:active {
    background-color: #20bd5a;
    color: white;
}

/* Login page */
.login-logo {
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

/* Floating action button */
.fab-novo {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--co-amarelo);
    color: var(--co-preto);
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    font-size: 28px;
    text-decoration: none;
}

/* Resultados da busca rápida - defensivo: só aparece com display:block explícito */
.search-results {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bs-body-bg, #fff);
    z-index: 1000;
    overflow-y: auto;
    padding-bottom: 80px;
    display: none !important;
}
.search-results.visible {
    display: block !important;
}

/* Invoice - detalhe do atendimento */
.invoice-logo img {
    max-height: 48px;
}

/* Placa do veículo */
.placa-display {
    font-family: monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
    border: 2px solid #333;
}

/* Camera OCR */
.camera-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    max-height: 300px;
}

.camera-container video {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px dashed var(--co-amarelo);
    width: 260px;
    height: 60px;
    border-radius: 8px;
    pointer-events: none;
}

/* Formulário inline de itens */
.item-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

/* Totais do atendimento */
.totais-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

.totais-box .total-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.totais-box .total-line.total-geral {
    border-top: 2px solid var(--co-preto);
    font-weight: 700;
    font-size: 18px;
    margin-top: 8px;
    padding-top: 12px;
}

/* Gráficos */
.chart-container {
    position: relative;
    height: 250px;
}

/* Fiado em aberto - destaque */
.fiado-aberto {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

/* Tipo veículo badge */
.tipo-veiculo {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Ajustes responsivos */
@media (max-width: 375px) {
    .card-stat .stat-value {
        font-size: 20px;
    }
}

/* Remove scrollbar horizontal */
body {
    overflow-x: hidden;
}

/* Form button - telas internas, sem position:fixed */
.cdo-form-action {
    padding: 16px;
    padding-bottom: 24px;
}
.has-bottom-menu .cdo-form-action {
    padding-bottom: 80px;
}
.cdo-form-action .btn {
    width: 100%;
}

/* Extra padding no conteúdo para não ficar atrás do bottom menu */
#appContent {
    padding-bottom: 20px;
}

/* Listview ajustes */
.listview .item .in .text-muted {
    font-size: 12px;
}

/* Action sheet para renovações */
.action-renovacao .action-sheet-content {
    padding: 16px;
}
