/* Reset & Base */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f4f7f6;
    color: #2d3748;
}

/* Modern top navigation */
.top-nav{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 20px;
    background: linear-gradient(90deg,#ffffffcc, #f1f5f9cc);
    border-bottom:1px solid rgba(16,24,40,0.05);
    box-shadow: 0 2px 6px rgba(16,24,40,0.03);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Animação suave */
}
.top-nav .brand h2{
    margin:0;
    font-size:1.15rem;
    color:#0f172a;
}
.nav-actions{
    display:flex;
    align-items:center;
    gap:18px;
}
.nav-list{list-style:none;margin:0;padding:0;display:flex;gap:10px}
.nav-link{
    text-decoration:none;
    padding:8px 12px;
    border-radius:8px;
    color:#0f172a;
    font-weight:500;
    transition: all .15s ease-in-out;
}
.nav-link:hover{background:rgba(2,6,23,0.04);transform:translateY(-1px)}
.user-block{display:flex;align-items:center;gap:10px}
.username{color:#334155;font-size:0.95rem}
.logout-btn{background:#ef4444;color:white;padding:6px 10px;border-radius:8px;text-decoration:none;font-weight:600}
.logout-btn:hover{filter:brightness(.95)}

/* Login Page Specifics */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation */
nav {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
nav h2 { margin: 0; color: #333; font-size: 1.4rem; }
nav a { text-decoration: none; color: inherit; transition: transform 0.2s; display: inline-block; }
.user-info { color: #666; font-size: 0.95rem; }
.logout-link { color: #e74c3c; font-weight: 600; margin-left: 10px; }

/* Layout */
.container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Animação suave */
}

/* Hero / Card Section */
.hero {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}
.login-page .hero {
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.hero-header {
    background: transparent;
    box-shadow: none;
    margin-bottom: 2.5rem;
    text-align: center;
    padding: 0;
}
.hero-header h1 { color: #2d3748; margin-bottom: 0.5rem; }
.hero-header p { color: #718096; }

/* Forms */
.form-group, p { margin-bottom: 1.2rem; text-align: left; }
label { display: block; margin-bottom: 0.5rem; color: #555; font-weight: 600; font-size: 0.9rem; }
input, select {
    width: 100%; padding: 0.8rem; border: 1px solid #ddd;
    border-radius: 6px; box-sizing: border-box; font-size: 1rem;
    transition: border-color 0.3s;
}
input:focus, select:focus { border-color: #764ba2; outline: none; }

/* Buttons */
.cta-button, button[type="submit"] {
    width: 100%; padding: 0.9rem; background-color: #764ba2;
    color: white; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600;
    cursor: pointer; margin-top: 1rem; transition: transform 0.2s;
    display: block; text-align: center; text-decoration: none;
}

.cta-button-403-ir-login {
    width: 40%; padding: 0.9rem; background-color: #df1f1f;
    color: white; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600;
    cursor: pointer; margin-top: 1rem; transition: transform 0.2s;
    display: inline-block; text-align: center; text-decoration: none;
}

.cta-button-export-csv {
    width:100%; padding: 0.9rem; background-color: #38a169;
    color: white; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600;
    cursor: pointer; margin-top: 1rem; transition: transform 0.2s;
    display: inline-block; margin: 0 15px; text-align: center; text-decoration: none;
    


    
}


/* .cta-button-inventario-entrada, button[type="submit"] {
    width: 100%; padding: 0.9rem; background-color: #60bd3e;
    color: white; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600;
    cursor: pointer; margin-top: 1rem; transition: transform 0.2s;
    display: block; text-align: center; text-decoration: none;
}*/




.cta-button:hover { transform: translateY(-2px); }

.button-group {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.btn-secondary {
    background-color: #5a67d8;
}


/* Grid & Features */
.grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem;
}
.feature-item {
    background: white; padding: 2rem; border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); text-align: center;
    text-decoration: none; color: #4a5568; display: block;
    border: 1px solid #e2e8f0; transition: transform 0.2s, box-shadow 0.2s;
}
.feature-item:hover {
    transform: translateY(-5px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); border-color: #cbd5e0;
}
.feature-item h3 { margin-top: 0; color: #5a67d8; font-size: 1.25rem; }
.feature-item i { font-size: 2.5rem; color: #764ba2; margin-bottom: 1rem; display: block; }
.feature-item p { font-size: 0.9rem; color: #718096; }

/* Lists (e.g. Estoque) */
.item-list { list-style: none; padding: 0; }
.item-list li {
    background: white; padding: 1rem; margin-bottom: 0.5rem;
    border-radius: 6px; border: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.item-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-color: #cbd5e0;
}

/* Messages */
.error-msg, .messages li {
    color: #e74c3c; font-size: 0.9rem; margin-top: 1rem;
    background: #fdecea; padding: 0.5rem; border-radius: 4px; list-style: none;
}

.success-msg, .messages li {
    color: #83a79a; font-size: 0.9rem; margin-top: 1rem;
    background: #d9ecdc; padding: 0.5rem; border-radius: 4px; list-style: none;
}

h2 { color: #333; margin-bottom: 1.5rem; margin-top: 0; }
hr { border: 0; border-top: 1px solid #e2e8f0; margin: 2rem 0; }


.entrada {
    font-weight: bold;
    color: #2ecc71;
}

.saida {
    font-weight: bold;
    color: #e74c3c;
}

/* Modern Table Styles */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow-x: auto;
    display: block;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.modern-table th, .modern-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.modern-table th {
    background-color: #f8fafc;
    color: #718096;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.modern-table tr:hover td {
    background-color: #f7fafc;
}

/* Container para os botões */
.btn-container {
    display: flex;
    gap: 10px; /* Espaço consistente entre botões */
    align-items: center; /* Alinha verticalmente */
}

/* Botões com estilos iguais exceto cor */
.btn-editar, .btn-excluir {
    font-weight: 600;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    background-color: #ebf4ff;
    transition: background-color 0.2s;
    white-space: nowrap; /* Evita quebra de linha */
}

.btn-editar { color: #5a67d8; }
.btn-excluir { color: #e74c3c; }

.btn-editar:hover {
    background-color: #c3dafe;
}

.btn-excluir:hover {
    background-color: #c3dafe;
}

/* Estilos para linhas agrupadas */
.child-row td {
    border-bottom: 1px dashed #e2e8f0;
}

.child-row:last-child td {
    border-bottom: 1px solid #e2e8f0;
}

/* Customização do Select2 para igualar aos outros campos do formulário */
.select2-container .select2-selection--single {
    height: 42px !important; /* Altura ajustada para inputs com padding */
    border: 1px solid #cbd5e0 !important; /* Mesma cor de borda dos inputs */
    border-radius: 0.375rem !important;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
    color: #1a202c !important;
    padding-left: 0.75rem !important;
    width: 100%;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
}

/* Ícones dos Bancos */
.bank-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Deixa redondinho */
    object-fit: contain; /* Garante que o logo não distorça */
}

/* --- Estilos do Menu Hamburger --- */

/* Botão Hamburger */
.menu-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    padding: 0;
    z-index: 1001; /* Fica acima do menu lateral */
    order: -1; /* Coloca o botão antes do user-block */
    position: relative; /* Garante o z-index fora do flex container */
    margin: 1rem 0 0 1.5rem; /* Ajuste de posicionamento */
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Animação suave */
}

.menu-toggle-btn span {
    width: 100%;
    height: 3px;
    background-color: #0f172a;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Animação do botão para 'X' */
.menu-toggle-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle-btn.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Container do Menu Lateral */
.side-menu-container {
    position: fixed;
    top: 0;
    left: -300px; /* Largura fixa negativa */
    width: 300px; /* Largura fixa do menu */
    height: 100%;
    background-color: #f4f7f6; /* Mesma cor de fundo do body */
    padding: 6rem 1.5rem 1.5rem;
    box-sizing: border-box;
    z-index: 1000;
    transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
    border-right: 1px solid #e2e8f0; /* Borda sutil para separar do conteúdo */
    box-shadow: 5px 0 15px rgba(0,0,0,0.05); /* Sombra para dar profundidade */
}

/* Estilo de Lista para o Menu Lateral */
.side-menu-list {
    display: flex;
    flex-direction: column;
}

.side-menu-item {
    display: block;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: left;
}

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

.side-menu-item:hover {
    padding-left: 10px;
    background-color: transparent; /* Remove fundo branco se houver */
}

.side-menu-item h3 { margin: 0 0 0.5rem 0; color: #2d3748; font-size: 1.1rem; }
.side-menu-item p { margin: 0; color: #718096; font-size: 0.9rem; }


.side-menu-container.open {
    left: 0; /* Desliza para a tela */
}

/* Efeito de Empurrar (Push) o Conteúdo */
body.menu-open .container,
body.menu-open .top-nav,
body.menu-open .menu-toggle-btn {
    transform: translateX(300px); /* Move o conteúdo para a direita */
}

/* Em telas pequenas (celular), mantém o comportamento de cobrir (overlay) para não espremer o conteúdo */
@media (max-width: 768px) {
    .side-menu-container { width: 100%; left: -100%; border-right: none; }
    body.menu-open .container, body.menu-open .top-nav, body.menu-open .menu-toggle-btn { transform: none; }
}

/* --- Paginação --- */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.btn-page {
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    color: #4a5568;
    background-color: white;
    transition: all 0.2s;
}

.btn-page:hover {
    background-color: #edf2f7;
    border-color: #a0aec0;
}

.current-page {
    padding: 0.5rem 1rem;
    color: #718096;
    font-weight: 600;
}

/* --- Alertas Modernos (Subtle/Flash Style) --- */
.modern-alert {
    padding: 1rem 1.2rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.alert-error {
    background-color: #fff5f5; /* Fundo muito suave (quase branco) */
    border: 1px solid #fed7d7;
    border-left: 4px solid #e53e3e; /* Borda de destaque lateral */
    color: #2d3748;
}

/* --- Alternar Visibilidade da Senha (Olho) --- */
.password-wrapper {
    position: relative;
    display: block;
}

.password-wrapper input {
    padding-right: 3rem; /* Espaço para não sobrepor o texto com o ícone */
}

.toggle-password-btn {
    position: absolute;
    top: 50%;
    right: 0.8rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toggle-password-btn:hover {
    color: #4a5568;
}

/* --- Modificadores de Botão --- */
.cta-button.btn-success {
    background-color: #38a169;
}

.cta-button.btn-success:hover {
    background-color: #2f855a;
}

/* --- Barra de Força da Senha --- */
.password-strength-meter {
    height: 4px;
    background-color: #e2e8f0;
    margin-top: 8px;
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
    display: none; /* Oculto por padrão */
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-weak { background-color: #e53e3e; width: 33%; }
.strength-medium { background-color: #ecc94b; width: 66%; }
.strength-strong { background-color: #38a169; width: 100%; }

.strength-text {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
}

/* --- Caixa de Requisitos de Senha --- */
.password-requirements {
    background-color: #f7fafc; /* Fundo cinza claro */
    border: 1px solid #e2e8f0;
    border-left: 4px solid #667eea; /* Borda de destaque azul/roxa */
    padding: 1rem 1.2rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.password-requirements strong {
    display: block;
    margin-bottom: 0.8rem;
    color: #2d3748;
    font-size: 0.95rem;
}

.password-requirements ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem 1.5rem;
}

.password-requirements li {
    font-size: 0.85rem;
    color: #4a5568;
    position: relative;
    padding-left: 1.2rem;
}

/* Marcador para a lista de requisitos */
.password-requirements li::before {
    content: "✓"; /* Checkmark */
    position: absolute;
    left: 0;
    top: 1px;
    color: #667eea;
    font-weight: bold;
}

/* Erro de campo individual (inline) */
.field-error {
    color: #c53030;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Ajuste responsivo para alertas em telas menores */
@media (max-width: 768px) {
    /* O grid auto-fit acima já cuida da responsividade automaticamente */
    .password-requirements ul {
        grid-template-columns: 1fr;
    }
}

/* --- Tooltip Moderno --- */
[data-tooltip] {
    position: relative;
    cursor: pointer;
    display: inline-block
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px) scale(0.8);
    background-color: #1a202c;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 100;
    pointer-events: none;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    border: 6px solid transparent;
    border-top-color: #1a202c;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    z-index: 100;
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px) scale(1);
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}