/* ==========================================================================
   DESIGN SYSTEM & ANIMAÇÕES PREMIUM - IVRNET
   ========================================================================== */

:root {
    /* Paleta Deep Dark */
    --bg-body: #090d16;
    --bg-sidebar: #111827;
    --bg-card: #1f2937;
    --bg-card-hover: #2d3748;

    /* Tipografia e Textos */
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dark: #64748b;

    /* Bordas e Divisores */
    --border-color: #2e374a;
    --border-subtle: rgba(255, 255, 255, 0.08);

    /* Cores de Ação (Acentos) */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.35);
    --sidebar-active: rgba(37, 99, 235, 0.15);

    /* Identificadores e Botões */
    --backId: rgba(99, 102, 241, 0.15);
    --backBtn: rgba(255, 255, 255, 0.05);

    /* Geometria e Sombras */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 10px 30px rgba(0, 0, 0, 0.5);

    /* Status Badges */
    --pendendeteBorda: rgba(239, 68, 68, 0.3);
    --pendenteFundo: rgba(239, 68, 68, 0.12);
    --pendenteLetra: #fca5a5;

    --separadoBorda: rgba(59, 130, 246, 0.3);
    --separadoFundo: rgba(59, 130, 246, 0.12);
    --separadoLetra: #93c5fd;

    --enviadoBorda: rgba(34, 197, 94, 0.3);
    --enviadoFundo: rgba(34, 197, 94, 0.12);
    --enviadoLetra: #86efac;
}

/* ==========================================================================
   1. KEYFRAMES DE ANIMAÇÕES LOCAIS E GLOBAIS
   ========================================================================== */

/* Entrada suave de telas e elementos */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Entrada dos itens da lista em cascata */
@keyframes itemCascade {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Abertura Fluida para Modais */
@keyframes modalPop {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Spinner de Carregamento */
@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   2. RESET & ESTRUTURA GLOBAL
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   TELA DE LOGIN (CORRIGIDO E CENTRALIZADO)
   ========================================================================== */

.login-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-body);
    padding: 20px;
}

/* Trava da Logo para não estourar a tela */
.img-logo {
    width: 100%;
    max-width: 280px; /* Limita o tamanho máximo da logo */
    height: auto;
    margin-bottom: 24px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* Card do Formulário de Login */
.login-container {
    background-color: var(--bg-sidebar);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glow);
    width: 100%;
    max-width: 420px; /* Largura perfeita para o formulário */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ajuste nos inputs do formulário de login */
.login-container .form-control {
    background-color: var(--bg-body) !important;
}

/* ==========================================================================
   OBSERVAÇÕES DO MODAL (EXPANDIDO)
   ========================================================================== */

/* Faz o painel do usuário/observações ocupar a altura e esticar */
.sidebar-panels-pro .panel-card-pro:first-child {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Expande a caixa de texto de Observações */
#tObservacoes {
    min-height: 180px !important;
    height: 100% !important;
    resize: vertical;
}

/* ==========================================================================
   3. SIDEBAR E NAVEGAÇÃO
   ========================================================================== */

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    border-right: 1px solid var(--border-color);
    z-index: 95;
}

.brand-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.brand-logo {
    height: 85px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.brand-logo:hover {
    transform: scale(1.05) rotate(-1deg);
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(5px);
}

.nav-link.active {
    background-color: var(--primary);
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 4px 16px var(--primary-glow);
    border-color: rgba(255, 255, 255, 0.15);
}

#user {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    padding: 12px 16px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: border-color 0.2s;
}

#user:hover {
    border-color: var(--primary);
}

/* LOGO OCULTA NO DASHBOARD (Apenas telas grandes) */
.imgDasboard {
    display: flex;
    justify-content: center;
    padding: 20px;
    margin-top: 0px;
}

.logoBaixo {
    width: 0px;
    opacity: 0.5;
    transition: opacity 0.3s ease, width 0.3s ease;
}

@media screen and (min-width: 1900px) {
    .logoBaixo {
        width: 200px;
        opacity: 0.5;
    }
}

/* ==========================================================================
   4. ESTRUTURA PRINCIPAL & TROCA DE PÁGINAS
   ========================================================================== */

.main-wrapper {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.content {
    padding: 24px;
    flex: 1;
}

/* Troca de Páginas com Animação Smooth */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card {
    background: var(--bg-sidebar);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   5. FORMULÁRIOS & BOTÕES
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-body);
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-sidebar);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-main);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px var(--primary-glow);
}

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

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================================================
   6. AUTOCOMPLETE DROPDOWN
   ========================================================================== */

.dropdown-produtos {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    color: var(--text-main);
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glow);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    animation: fadeInUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dropdown-produtos li {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease, padding-left 0.15s ease;
}

.dropdown-produtos li:last-child {
    border-bottom: none;
}

.dropdown-produtos li:hover {
    background-color: var(--primary);
    color: #ffffff;
    padding-left: 22px;
}

/* ==========================================================================
   7. DASHBOARD & LISTA DE PEDIDOS
   ========================================================================== */

.dashboardSection {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.menuEsquerda {
    width: 290px;
    background-color: var(--bg-sidebar);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    list-style: none;
    padding-bottom: 20px;
    overflow: hidden;
}

.menuEsquerda > h2 {
    font-size: 18px;
    padding: 20px 24px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.navFiliais {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.navFiliais i {
    font-style: normal;
}

.navFiliais:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    padding-left: 24px;
}

.navFiliais.ativa {
    background-color: var(--sidebar-active);
    border-left: 4px solid var(--primary);
    color: #60a5fa;
    font-weight: 600;
}

.menuPedidos {
    flex: 1;
    min-width: 320px;
    background-color: var(--bg-sidebar);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
}

.menuPedidos > h2 {
    font-size: 18px;
    margin-bottom: 20px;
}

.geraisDashboard {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-body);
    width: 100%;
    overflow: hidden;
}

.tagsPedido {
    display: grid !important;
    grid-template-columns: 110px 1fr 130px 140px !important; /* Aumentado de 80px para 110px */
    gap: 15px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    background-color: var(--bg-sidebar);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap; /* Impede a quebra de texto em duas linhas */
}

.sectionPedidos {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 500px;
    overflow-y: auto;
}

.pedidoInformacoes {
    display: grid !important;
    grid-template-columns: 110px 1fr 130px 140px !important; /* Aumentado de 80px para 110px */
    gap: 15px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease, transform 0.15s ease;
    color: var(--text-main);
}

.pedidoInformacoes:hover {
    background-color: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transform: translateX(2px);
}

.idPedidoTela {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--backId);
    text-align: center;
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
    color: #818cf8;
}

.usuarioPedidoTela,
.dataPedidoTela {
    font-size: 14px;
    font-style: normal;
}

.statusPedidoTela {
    width: fit-content;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   8. TELA DE PRODUTOS (LAYOUT EM GRID TRAVADO E COMPACTO)
   ========================================================================== */

#produtos-page {
    display: none;
    flex-direction: column;
    height: calc(100vh - 110px);
    overflow: hidden;
}

#produtos-page.active {
    display: flex;
}

#produtos-page .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    margin-bottom: 0;
    padding: 24px;
}

/* Cabeçalho Fixo do Catálogo */
.product-list-header {
    display: grid !important;
    grid-template-columns: 90px minmax(180px, 1fr) 110px 110px 100px !important;
    gap: 15px;
    align-items: center;
    padding: 14px 20px;
    background-color: var(--bg-card);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Lista de Produtos com Scroll Isolado */
#global-product-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background-color: var(--bg-body);
}

/* Linha do Produto */
.product-list-item {
    display: grid !important;
    grid-template-columns: 90px minmax(180px, 1fr) 110px 110px 100px !important;
    gap: 15px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background-color 0.15s ease, transform 0.15s ease;
    background-color: var(--bg-sidebar);
    color: var(--text-main);
    font-size: 14px;
    animation: itemCascade 0.2s ease-out forwards;
}

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

.product-list-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateX(2px);
}

.product-list-item > span:first-child {
    font-weight: 700;
    color: #818cf8;
}

.product-list-item > span:last-child {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ==========================================================================
   9. MODAL PRO (EDIÇÃO DE PEDIDOS) - TELA & SCROLL TRAVADOS
   ========================================================================== */

.modal-overlay-pro {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9998;
}

.modal-overlay-pro.ativo {
    display: block;
}

.intensPedido {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    box-shadow: 0px 25px 70px rgba(0, 0, 0, 0.85);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    max-height: 85vh;
    z-index: 9999;
    overflow: hidden;
}

.intensPedido.ativo {
    display: flex;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header-pro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.title-group h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.date-text {
    color: var(--text-muted);
    font-size: 13px;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.select-status-custom {
    padding: 8px 12px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s;
}

.select-status-custom:focus {
    border-color: var(--primary);
}

.btn-outline-pro {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline-pro:hover {
    border-color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-close-pro {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.btn-close-pro:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.modal-body-pro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    padding: 20px 24px;
    background-color: var(--bg-sidebar);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-body-pro > div:first-child {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 12px;
}

#area-add-produto-edit {
    flex-shrink: 0;
}

.table-container-pro {
    background-color: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    position: relative;
}

.table-row-pro {
    display: grid;
    grid-template-columns: 70px 2fr 80px 100px 110px 40px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    transition: background 0.15s;
}

.table-row-pro.header-pro {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
}

.input-qtd-pro {
    width: 65px;
    padding: 6px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.input-qtd-pro:focus {
    border-color: var(--primary);
}

.btn-icon-danger {
    background: transparent;
    border: none;
    color: #f87171;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.btn-icon-danger:hover:not(:disabled) {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.15);
}

/* Ajusta o card do Usuário/Observações para expandir verticalmente */
.sidebar-panels-pro .panel-card-pro:first-child {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Força a caixa de texto a esticar para baixo */
#tObservacoes {
    min-height: 180px;
    height: 150%;
    resize: vertical; /* Permite que o operador ainda ajuste manualmente se quiser */
}

.panel-card-pro {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.resumo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.number-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: var(--primary-glow);
    color: #818cf8;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.modal-footer-pro {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    padding: 16px 24px;
    background-color: var(--bg-body);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.btn-footer-cancel {
    background-color: var(--bg-sidebar);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-footer-cancel:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-footer-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-footer-save:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* ==========================================================================
   10. TABELA DE RELATÓRIO
   ========================================================================== */

.tabela-relatorio {
    width: 100%;
    border-collapse: collapse;
    color: #f8fafc;
    font-size: 14px;
    table-layout: fixed;
}

.tabela-relatorio th, 
.tabela-relatorio td {
    padding: 14px 12px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--border-color);
}

.tabela-relatorio-produtos tr {
    transition: background 0.15s ease;
}

.tabela-relatorio-produtos tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.tabela-relatorio .text-left { text-align: left !important; }
.tabela-relatorio .text-center { text-align: center !important; }

.tabela-relatorio .col-filial {
    color: #38bdf8;
    text-align: center !important;
}

.tabela-container {
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-body);
}

.tabela-relatorio thead th {
    position: sticky;
    top: 0;
    background-color: var(--bg-sidebar);
    z-index: 1;
    box-shadow: inset 0 -2px 0 var(--border-color);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}



/* ==========================================================================
   OVERLAYS (LOADING & CONFIRMAÇÃO) - CENTRALIZADOS
   ========================================================================== */

.loading-overlay, .confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(6px);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.loading-overlay.ativo, .confirm-overlay.ativo {
    opacity: 1;
    pointer-events: all;
}

/* Trava de Centralização da Caixa Interna do Loading */
.loading-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 16px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
    margin: auto;
}

/* Spinner Giratório */
.spinner {
    width: 46px;
    height: 46px;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: girar 0.8s linear infinite;
    margin: 0 auto !important; /* Garante alinhamento horizontal cravado no centro */
    flex-shrink: 0;
}



.confirm-box {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    padding: 28px;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-glow);
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-overlay.ativo .confirm-box {
    transform: scale(1);
}

.confirm-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px auto;
}

.confirm-box h3 {
    margin: 0 0 8px 0;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 700;
}

.confirm-box p {
    margin: 0 0 24px 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-buttons button {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-cancel {
    background: var(--bg-body);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   12. SCROLLBARS PERSONALIZADAS
   ========================================================================== */

html {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-body);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   13. ESTADOS DESATIVADOS
   ========================================================================== */

#edit-prod-nome:disabled {
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

#edit-prod-nome:disabled:hover {
    opacity: 0.35 !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
    cursor: not-allowed !important;
}

.btn-icon-danger:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

.btn-icon-danger:disabled:hover {
    color: #f87171 !important;
    background: transparent !important;
}

/* ==========================================================================
   14. RESPONSIVIDADE
   ========================================================================== */

@media screen and (max-width: 900px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 15px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .brand-area {
        margin-bottom: 20px;
        justify-content: center;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .nav-link {
        margin-bottom: 0;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .header {
        padding: 16px 20px;
    }

    .content {
        padding: 20px 10px;
    }

    .menuEsquerda {
        width: 100%;
    }

    .menuPedidos {
        padding: 15px;
    }

    .tagsPedido {
        display: none;
    }

    .pedidoInformacoes {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 15px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: 10px;
        background-color: var(--bg-sidebar);
    }
}

/* Coluna de estoque */
.produto-estoque {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-weight: 700;
}

.produto-estoque.estoque-zero {
    color: #ef4444;
}

