﻿/* ==========================================================================
   CONFIGURAÇÕES GERAIS E TIPOGRAFIA
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.field-required-message {
    font-size: 0.72rem;
    font-weight: 600;
    color: #dc3545;
    margin-left: 8px;
}

/* ==========================================================================
   CORES E GRADIENTES (PADRÃO apPF)
   ========================================================================== */
.bg-apPF {
    background: linear-gradient(135deg, #FF8C00 0%, #FF4500 100%) !important;
}

.text-orange {
    color: #FF4500 !important;
}

.btn-orange {
    background: linear-gradient(135deg, #FF8C00 0%, #FF4500 100%);
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-orange:hover {
    background: linear-gradient(135deg, #FF4500 0%, #FF8C00 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 69, 0, 0.3);
}

.btn-print {
    background-color: #d35400;
    border: none;
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-print:hover {
    background-color: #a04000;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(211, 84, 0, 0.3);
}

/* ==========================================================================
   NAVBAR E MENU
   ========================================================================== */
.navbar {
    padding: 0.8rem 1rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.6rem 1.2rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dropdown (Sub-menu) */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #FFF5E6;
    color: #FF4500;
    padding-left: 1.5rem;
}

/* ==========================================================================
   GRID / TABELA ESTILO CARD (MODERNA)
   ========================================================================== */

/* Remove limites de corte para permitir sombras e efeitos de subir */
.table-responsive {
    overflow: visible !important;
    padding: 5px;
}

.table-custom {
    border-collapse: separate;
    border-spacing: 0 6px; /* Espaço entre as linhas reduzido para um visual mais fino */
    background-color: transparent !important;
}

/* CABEÇALHO CINZA SUAVE */
.table-custom thead tr th {
    background: #f1f3f5 !important; /* Cor cinza suave */
    color: #495057 !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 10px 15px !important; /* Header mais compacto */
    border: none !important;
}

/* LINHAS QUE PARECEM CARDS */
.table-custom tbody tr {
    background-color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease-in-out;
    cursor: default;
}

/* Efeito ao passar o rato (Subir o card) */
.table-custom tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
    position: relative;
    z-index: 5;
}

.table-custom tbody td {
    padding: 8px 15px !important; /* Redução significativa do preenchimento vertical */
    border: none !important;
    background-color: #ffffff !important;
}

/* Arredondamento dos Cards (Linhas) */
.table-custom tbody tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.table-custom tbody tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Bordas de Status para o Grid */
.border-status-open { border-left: 5px solid #FF8C00 !important; }
.border-status-approved { border-left: 5px solid #28a745 !important; }
.border-status-rejected { border-left: 5px solid #dc3545 !important; }
.border-status-info { border-left: 5px solid #007bff !important; }
.border-status-default { border-left: 5px solid #6c757d !important; }

/* RESPONSIVIDADE: Transforma Tabela em Cards no Mobile */
@media (max-width: 768px) {
    .table-custom thead { display: none; } /* Esconde o cabeçalho no mobile */
    
    .table-custom, .table-custom tbody, .table-custom tr, .table-custom td {
        display: block;
        width: 100%;
    }

    .table-custom tbody tr {
        margin-bottom: 1.5rem;
        border-radius: 12px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important; /* Estilo Card Slim */
        padding: 10px;
        border: 1px solid rgba(0,0,0,0.05) !important;
    }

    .table-custom tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 8px 15px !important; /* Ajuste fino também no mobile */
        border-bottom: 1px solid #f1f3f5 !important;
    }

    .table-custom tbody td:last-child { border-bottom: none !important; }
    
    .table-custom tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: #6c757d;
    }
}

/* Badges Customizadas */
.bg-success-subtle {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.bg-danger-subtle {
    background-color: #f8d7da !important;
    color: #842029 !important;
}

/* ==========================================================================
   DASHBOARD CARDS SLIM
   ========================================================================== */
.card-slim {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card-slim:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 2rem;
    color: #0056b3 !important;
    opacity: 0.6;
    position: absolute;
    right: 15px;
    bottom: 10px;
}

/* Ajustes para Itens Expansíveis */
.cursor-pointer { cursor: pointer; }
.transition-icon { transition: transform 0.3s ease; }
.collapsed .transition-icon { transform: rotate(-90deg); }
.nav-tabs .nav-link.active {
    color: #FF4500 !important;
    border-bottom: 2px solid #FF4500 !important;
    background: transparent !important;
}

/* Custom background for table headers */
.bg-table-header {
    background: #f1f3f5 !important;
}
/* ===========================================================================
   RESUMO DO PEDIDO
   =========================================================================== */
.pedido-status-badge {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.2;
}

/* ==========================================================================
   PEDIDOS - BASE VISUAL PADRÃO DO DASHBOARD
   ========================================================================== */
.pedido-page {
    background: #f8f9fa;
}

.pedido-hero {
    background: #ffffff;
    border-left: 5px solid #FF8C00;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 1.15rem 1.25rem;
}

.pedido-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.pedido-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
}

.pedido-card .card-header {
    background: #ffffff;
    padding-top: 1rem;
    padding-bottom: 0.8rem;
}

.pedido-card .card-body {
    padding: 1.25rem;
}

.pedido-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}

.pedido-meta .meta-box {
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 0.95rem;
    padding: 1rem 1.05rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.03);
}

.pedido-meta .meta-label {
    display: block;
    margin-bottom: 0.3rem;
    color: #6c757d;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
}

.pedido-meta .meta-value {
    color: #1f2937;
    font-weight: 700;
    line-height: 1.3;
    font-size: 1rem;
}

.pedido-meta .meta-box-total {
    grid-column: 1 / -1;
}

.pedido-meta .meta-box-total .meta-value {
    font-size: 1.35rem;
    color: #d35400;
}

.pedido-accordion .accordion-item {
    border-radius: 12px !important;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    border: 1px solid rgba(0,0,0,0.08) !important;
    background: #fff;
}

.pedido-accordion .accordion-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08) !important;
    border-color: rgba(255, 140, 0, 0.22) !important;
}

.pedido-accordion .accordion-header {
    background: #f8f9fa;
}

.pedido-accordion .accordion-button {
    background: #ffffff;
    box-shadow: none;
    gap: 0.85rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-weight: 600;
}
    background: #fff;
    padding: 1.15rem 1.25rem 1.25rem;
}

.pedido-accordion .pedido-accordion-icon {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    color: #d35400;
    border: 1px solid rgba(211, 84, 0, 0.16);
    flex: 0 0 auto;
}

.pedido-accordion .accordion-button:not(.collapsed) .pedido-accordion-icon {
    transform: rotate(90deg);
    background: rgba(211, 84, 0, 0.10);
    border-color: rgba(211, 84, 0, 0.24);
}

@media (max-width: 768px) {
    .pedido-card .card-body,
    .pedido-accordion .accordion-body {
        padding: 1rem;
    }

    .pedido-meta {
        grid-template-columns: 1fr;
    }
}

