/**
 * Design System e Estilização Customizada do Projeto Carne
 * Cores Centralizadas: Mude as variáveis abaixo e o tema mudará por completo.
 */

:root {
    /* DUAS CORES CENTRAIS (Editáveis) */
    --primary-color: #41403f;
    /* Tom Escuro (ex: Azul Petróleo) */
    --secondary-color: #eeea17;
    /* Tom de Destaque (ex: Vermelho Coral) */

    /* Variáveis de suporte baseadas nas duas cores */
    --primary-light: rgba(44, 62, 80, 0.08);
    --primary-hover: #1a252f;
    --secondary-light: rgba(231, 76, 60, 0.12);
    --secondary-hover: #c0392b;

    /* Cores neutras complementares */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --text-dark: #2d3748;
    --text-muted: #718096;

    /* Outras configurações */
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Configurações Gerais */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Botões Customizados Baseados nas Cores Centrais */
.btn-primary-custom,
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--bg-white) !important;
    border-radius: 8px;
    padding: 10px 20px;
    transition: all var(--transition-speed) ease;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08) !important;
}

.btn-primary-custom:hover,
.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: var(--bg-white) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

#btn-novo-cliente,
#btn-emitir-carne,
#btn-novo-cliente:hover,
#btn-emitir-carne:hover {
    color: var(--secondary-color) !important;
}

.btn-secondary-custom,
.btn-secondary {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--bg-white) !important;
    border-radius: 8px;
    padding: 10px 20px;
    transition: all var(--transition-speed) ease;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08) !important;
}

.btn-secondary-custom:hover,
.btn-secondary:hover {
    background-color: var(--secondary-hover) !important;
    border-color: var(--secondary-hover) !important;
    color: var(--bg-white) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Botões de Ação de Tabela (Outline) */
.btn-outline-primary,
.btn-outline-info {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background-color: transparent !important;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

.btn-outline-primary:hover,
.btn-outline-info:hover {
    background-color: var(--primary-color) !important;
    color: var(--bg-white) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

.btn-outline-danger:hover {
    background-color: #dc3545 !important;
    color: var(--bg-white) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Layout de Sidebar e Conteúdo Principal */
#wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: var(--bg-white);
    flex-shrink: 0;
    transition: all var(--transition-speed) ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    height: auto;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--bg-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 24px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-menu li.active a {
    border-left-color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.12);
}

.sidebar-menu li a i {
    color: var(--secondary-color);
}

.sidebar-menu li a.sidebar-logout {
    color: var(--secondary-color) !important;
}

.sidebar-menu li a.sidebar-logout i {
    color: var(--secondary-color) !important;
}

.sidebar-border-top {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Conteúdo Principal */
#main-content {
    flex-grow: 1;
    overflow: hidden;
    background-color: #fefce8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M10 20h40v20H10z' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Ccircle cx='30' cy='30' r='6' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Cpath d='M15 25l3 3m27-3l-3 3M15 35l3-3m27 3l-3-3' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Navbar de Topo (Responsivo) */
.top-navbar {
    position: relative;
    background-color: var(--primary-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 75px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 992px) {
    .top-navbar {
        display: none !important;
    }
}

#section-title {
    display: none !important;
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    /* Oculto no Desktop */
}

/* Área de Páginas */
.content-body {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Cards Premium */
.custom-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 25px;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.content-body .custom-card:last-child {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.custom-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* Estilização de Tabelas Premium */
.custom-table-container {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    margin-top: 15px;
}

.custom-table {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
}

.custom-table thead th {
    background-color: var(--primary-color);
    color: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 1;
}

.custom-table thead th:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.custom-table th {
    text-align: center !important;
    font-weight: 600;
    padding: 16px 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
}

.custom-table td {
    text-align: center !important;
    padding: 16px 20px;
    color: var(--text-dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Badges e Status */
.badge-custom-primary {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.badge-custom-secondary {
    background-color: var(--secondary-light);
    color: var(--secondary-color);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.badge-custom-success {
    background-color: rgba(46, 204, 113, 0.15);
    color: #27ae60;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.badge-custom-warning {
    background-color: rgba(241, 196, 15, 0.15);
    color: #d35400;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

/* Efeito de Destaque / Focus para inputs */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem var(--primary-light);
}

/* Responsividade Customizada */
@media (max-width: 991.98px) {

    /* No Tablet */
    .menu-toggle-btn {
        display: block;
        /* Exibe botão no Tablet */
    }
}

@media (max-width: 767.98px) {

    /* No Mobile */
    #sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0;
        bottom: 0;
    }

    #sidebar.show {
        left: 0;
    }

    /* Overlay escuro quando a sidebar abre no mobile */
    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        transition: opacity var(--transition-speed) ease;
    }

    #sidebar-overlay.show {
        display: block;
    }

    .top-navbar {
        padding: 15px 20px;
    }

    .content-body {
        padding: 20px 15px;
    }

    .custom-table th,
    .custom-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
}

/* Transições Suaves para animações de carregamento de seções */
.fade-in-section {
    animation: fadeIn 0.4s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Unificar largura dos botões do SweetAlert2 */
.swal2-actions button.swal2-styled {
    width: 130px !important;
    justify-content: center;
}

/* Card de busca com fundo da cor do tema */
.card-theme-bg {
    background-color: var(--primary-color) !important;
    border: none !important;
}

.card-theme-bg label {
    color: var(--bg-white) !important;
}

.card-theme-bg .input-group-text {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: var(--bg-white) !important;
}

.card-theme-bg .input-group-text i {
    color: var(--bg-white) !important;
}

.card-theme-bg input.form-control {
    background-color: var(--bg-white) !important;
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.card-theme-bg input.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
}

/* Unificação dos botões de rodapé dos modais */
.modal-footer {
    display: flex;
    justify-content: center;
    /* Centraliza ou empurra conforme layout */
    gap: 10px;
}

.modal-footer .btn {
    width: 150px !important;
    height: 44px !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08) !important;
    transition: all var(--transition-speed) ease !important;
}

.modal-footer .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Botão de Fechar do modal sempre Vermelho */
.modal-footer .btn-outline-secondary {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}

.modal-footer .btn-outline-secondary:hover {
    background-color: #dc3545 !important;
    color: var(--bg-white) !important;
}

/* Área de Texto Não Redimensionável */
.textarea-no-resize {
    resize: none;
}

/* Botões do Filtro de Histórico alinhados com inputs */
.btn-filter {
    height: 38px !important;
    padding: 0 15px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Badges do Setor no Histórico com largura igual */
.badge-setor {
    display: inline-block !important;
    width: 90px !important;
    text-align: center !important;
}

/* Coluna com ajuste de largura ao conteúdo */
.col-fit {
    width: 1% !important;
    white-space: nowrap !important;
}

/* ========================================================================= */
/* ESTILOS DA TELA DE LOGIN                                                  */
/* ========================================================================= */
.login-body-bg {
    background-color: #fefce8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M10 20h40v20H10z' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Ccircle cx='30' cy='30' r='6' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Cpath d='M15 25l3 3m27-3l-3 3M15 35l3-3m27 3l-3-3' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3C/svg%3E");
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 850px;
    min-height: 460px;
    display: flex;
    flex-direction: row;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 45px;
    text-align: center;
    position: relative;
    flex: 0.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
}

.login-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.login-brand img {
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
    height: auto;
    width: auto;
}

.login-header p {
    margin-top: 15px !important;
    text-align: center;
}

.login-body {
    flex: 1.4;
    padding: 45px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-body h4 {
    color: var(--primary-color);
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
    color: var(--primary-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(44, 62, 80, 0.15);
}

.login-card .input-group-text {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--secondary-color) !important;
}

.login-card .input-group-text:focus-within {
    border-color: var(--primary-color);
}

.alert-custom {
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group-text i,
.input-group-text .bi-funnel,
.input-group-text .bi-search,
i.bi-search,
i.bi-funnel {
    color: var(--secondary-color) !important;
}

/* Responsividade Login */
@media (max-width: 768px) {
    .login-card {
        flex-direction: column !important;
        max-width: 450px !important;
        min-height: auto !important;
    }
    .login-header::after {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        height: 4px;
        width: auto;
        background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    }
}

.bg-subtle-yellow {
    background-color: #fefce8 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M10 20h40v20H10z' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Ccircle cx='30' cy='30' r='6' fill='none' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3Cpath d='M15 25l3 3m27-3l-3 3M15 35l3-3m27 3l-3-3' stroke='rgba(238, 234, 23, 0.08)' stroke-width='1.5'/%3E%3C/svg%3E") !important;
}