/* ===================================================================
   CONFIGURAÇÕES GERAIS E VARIÁVEIS
   =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-orange: #FF6B35;
    --secondary-orange: #FF8C42;
    --dark-black: #1a1a1a;
    --sidebar-bg: #232323;
    --pure-white: #ffffff;
    --light-gray: #f4f5f7;
    --medium-gray: #e5e7eb;
    --text-gray: #6b7280;
    --text-light: #d1d5db;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --error-red: #ef4444;
    --info-blue: #3b82f6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-black);
    line-height: 1.6;
}
/* --- CSS PARA IMPRESSÃO --- */
@media print {
    /* Esconde o menu lateral, o cabeçalho e o rodapé */
    .sidebar, .content-header, .sidebar-footer, footer {
        display: none !important;
    }

    /* Faz o conteúdo principal ocupar a página inteira */
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    /* Esconde a barra de filtros e os botões de ação na impressão */
    .card.mb-3, .table th:last-child, .table td:last-child {
        display: none !important;
    }

    /* Garante que o card da tabela use todo o espaço */
    .card {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
    }

    /* Remove a cor de fundo das linhas vencidas na impressão */
    tr[style*="background-color"] {
        background-color: transparent !important;
    }
}


/* ===================================================================
 ANIMAÇÃO PARA NOTIFICAÇÕES URGENTES
   =================================================================== */
   
.pulsate {
    animation: pulsate-animation 1.5s infinite;
}

@keyframes pulsate-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.pulsate-alert {
    animation: pulsate-alert-animation 1.5s infinite;
    border: 1px solid #dc3545;
}

@keyframes pulsate-alert-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* ===================================================================
   LAYOUT PRINCIPAL (SIDEBAR E CONTEÚDO)
   =================================================================== */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: var(--light-gray);
    transition: margin-left 0.3s ease;
}

.content-header {
    background: var(--pure-white);
    padding: 16px 24px;
    border-bottom: 1px solid var(--medium-gray);
}

.content-body {
    padding: 24px;
}

/* ===================================================================
   MENU LATERAL (SIDEBAR-MENU)
   =================================================================== */
.sidebar-menu {
    list-style: none;
    padding: 16px 0;
    margin: 0;
    flex-grow: 1;
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 24px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}
.sidebar-menu li a:hover {
    background-color: var(--primary-orange);
    color: white;
}
.sidebar-menu li.active > a {
    background-color: var(--primary-orange);
    color: white;
    font-weight: 600;
}
.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}
.sidebar-menu li.has-submenu > a { position: relative; }
.sidebar-menu .arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    font-size: 12px;
}
.sidebar-menu li.has-submenu.active .arrow {
    transform: translateY(-50%) rotate(180deg);
}
.sidebar-menu .submenu {
    display: none;
    list-style: none;
    padding-left: 0;
    background-color: rgba(0,0,0,0.2);
}
.sidebar-menu .submenu li a {
    padding-left: 59px;
    font-size: 14px;
    color: #a7a7a7;
}
.sidebar-menu .submenu li a:hover { color: white; }
.sidebar-footer {
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 24px;
    color: var(--text-light);
    text-decoration: none;
}
.sidebar-footer a:hover {
    background: var(--error-red);
    color: white;
}

/* ===================================================================
   HEADER COM ÍCONES
   =================================================================== */
.title-group h1 {
    font-size: 24px;
    margin: 0;
    line-height: 1.2;
}
.title-group .subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-gray);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.action-icons-group {
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--medium-gray);
    padding-right: 16px;
}
.action-icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-gray);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 18px;
    text-decoration: none;
}
.action-icon-btn:hover {
    background-color: var(--light-gray);
    color: var(--dark-black);
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--pure-white);
}
.notification-badge.success { background-color: var(--success-green); }
.notification-badge.danger { background-color: var(--error-red); }

/* ===================================================================
   USER PROFILE DROPDOWN
   =================================================================== */
.user-profile-dropdown {
    position: relative;
    cursor: pointer;
}
.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background-color: var(--pure-white);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1001;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}
.user-profile-dropdown.active .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--medium-gray);
}
.dropdown-header strong { display: block; color: var(--dark-black); }
.dropdown-header small { color: var(--text-gray); font-size: 12px; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
}
.dropdown-item i { width: 16px; text-align: center; }
.dropdown-item:hover { background-color: var(--light-gray); color: var(--primary-orange); }

/* ===================================================================
   GRID SYSTEM E STATS CARDS
   =================================================================== */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.stat-card { background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange)); color: white; padding: 24px; border-radius: 12px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; right: 0; width: 100px; height: 100px; background: rgba(255,255,255,0.1); border-radius: 50%; transform: translate(30px, -30px); }
.stat-value { font-size: 32px; font-weight: bold; margin-bottom: 8px; }
.stat-label { font-size: 14px; opacity: 0.9; }

/* ===================================================================
   COMPONENTES GERAIS
   =================================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border: none; border-radius: 8px; font-weight: 600; text-decoration: none; cursor: pointer; transition: all 0.3s ease; font-size: 14px; }
.btn-primary { background: var(--primary-orange); color: white; }
.btn-primary:hover { background: #e55a2b; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3); }
.btn-secondary { background: var(--medium-gray); color: var(--dark-black); }
.btn-secondary:hover { background: #d1d5db; }
.card { background: var(--pure-white); border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); overflow: hidden; }
.card-header { padding: 24px; border-bottom: 1px solid var(--medium-gray); }
.card-title { font-size: 20px; font-weight: 600; color: var(--dark-black); margin: 0; }
.card-subtitle { color: var(--text-gray); font-size: 14px; }
.card-body { padding: 24px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--dark-black); }
.form-control { width: 100%; padding: 12px 16px; border: 1px solid var(--medium-gray); border-radius: 8px; font-size: 14px; transition: border-color 0.3s ease; }
.form-control:focus { outline: none; border-color: var(--primary-orange); box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2); }
.table { width: 100%; border-collapse: collapse; }
.table th { background: #f9fafb; padding: 16px; text-align: left; font-weight: 600; color: var(--dark-black); }
.table td { padding: 16px; border-top: 1px solid var(--medium-gray); }
.table tr:hover { background: #f9fafb; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success-green); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-yellow); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--error-red); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info-blue); }

/* ===================================================================
   MODAL (CORREÇÃO PARA ROLAGEM)
   =================================================================== */
.modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-content { background: var(--pure-white); border-radius: 12px; padding: 0; width: 90%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { padding: 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--medium-gray); flex-shrink: 0; }
.modal-body { 
    padding: 24px; 
    overflow-y: auto; 
    flex-grow: 1; 
    min-height: 0;
}
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--medium-gray); display: flex; justify-content: flex-end; gap: 12px; background-color: #f9fafb; flex-shrink: 0; }
.close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-gray); }

/* ===================================================================
   PÁGINA DE LOGIN & ALERTAS
   =================================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
}
.login-card {
    background: var(--pure-white);
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: left;
}
.login-logo {
    margin-bottom: 24px;
    text-align: center;
}
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-red);
    color: var(--error-red);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* ===================================================================
   CORREÇÃO CALENDÁRIO DE ESTOQUE
   =================================================================== */
#calendario-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

/* ===================================================================
   RESPONSIVIDADE (CELULAR)
   =================================================================== */
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--dark-black); cursor: pointer; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 999; }

@media (max-width: 992px) {
    .sidebar { left: -280px; transition: left 0.3s ease-in-out; }
    .sidebar.active { left: 0; }
    .main-content { margin-left: 0; }
    .mobile-menu-toggle { display: block; }
    .header-actions .action-icons-group { display: none; }
    .user-greeting { display: none; }
    .title-group .subtitle { display: none; }
    .grid-2, .grid-3, .grid-4, .stats-grid { grid-template-columns: 1fr; }
    .sidebar-overlay.active { display: block; }

    #calendario-container {
        gap: 2px;
    }
    .dia-calendario {
        min-height: 60px;
        font-size: 10px;
        padding: 5px;
    }
    .dia-calendario .numero-dia {
        font-size: 12px;
    }
    .dia-semana {
        font-size: 11px;
        padding: 8px 2px;
    }
    
    .table-responsive-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===================================================================
   UTILITÁRIOS
   =================================================================== */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 24px; }
.mt-3 { margin-top: 24px; }
.p-0 { padding: 0 !important; }
.p-5 { padding: 40px; }
.text-center { text-align: center; }

/* ===================================================================
   ADJUSTES PARA TELA DE CELULAR
   =================================================================== */
@media (max-width: 576px) {
    .login-container {
        padding: 16px;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .login-card {
        padding: 24px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .login-logo {
        margin-bottom: 24px;
        text-align: center;
    }

    .form-control {
        font-size: 14px;
        padding: 12px 16px;
        margin-bottom: 16px;
    }

    .btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    .main-content {
        padding: 10px;
        margin-left: 0;
    }

    .table th, .table td {
        padding: 12px;
        font-size: 12px;
    }

    .table th {
        text-align: left;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
    }

    .modal-body {
        padding: 16px;
        max-height: 60vh;
        overflow-y: auto;
    }

    .stat-card {
        padding: 16px;
    }

    .header-actions .action-icons-group {
        display: none;
    }
    .header-actions .user-profile-dropdown {
        margin-left: auto;
    }
}
.modal .modal-body {
  max-height: 70vh; /* ou ajuste conforme sua necessidade */
  overflow-y: auto;
}
