/* ==========================================
   ACESSO E PAINEL ADMINISTRATIVO (Azul Escuro e Branco)
   ========================================== */

/* --- TELA DE LOGIN --- */
.bg-login { background: var(--bg-cinza-claro); }
.login-wrapper { display: flex; justify-content: center; align-items: center; min-height: 70vh; padding: 20px; }
.login-box { background: white; width: 100%; max-width: 450px; padding: 40px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: center; border: 1px solid var(--borda); }
.login-box h2 { font-size: 26px; color: var(--texto-preto); margin-bottom: 10px; font-weight: 800; letter-spacing: -0.5px;}
.login-box p { color: #666; font-size: 14px; margin-bottom: 30px; }
.input-group { text-align: left; margin-bottom: 20px; }
.input-group label { display: block; font-size: 13px; font-weight: 700; color: var(--texto-preto); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;}
.input-group input { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; outline: none; transition: 0.3s; background: #fafafa;}
.input-group input:focus { border-color: var(--cor-destaque); background: white; box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.1);}
.btn-entrar { width: 100%; padding: 16px; background: var(--cor-destaque); color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 800; cursor: pointer; transition: 0.3s; margin-bottom: 20px;}
.btn-entrar:hover { background: var(--cor-hover); transform: translateY(-2px); }
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { padding-right: 45px; }
.btn-eye { position: absolute; right: 10px; background: none; border: none; color: #999; cursor: pointer; display: flex; justify-content: center; width: 30px; height: 30px; transition: 0.3s; }
.btn-eye:hover { color: var(--cor-destaque); }
.btn-eye svg { width: 20px; height: 20px; }

/* --- TELA DE ADMINISTRAÇÃO (Novo Layout) --- */
.bg-admin { background-color: var(--bg-cinza-claro); height: 100vh; overflow: hidden; }
.admin-wrapper { display: flex; flex-direction: column; height: 100vh; }

/* Cabeçalho do Admin */
.admin-header-clean { background: var(--cor-destaque); color: white; display: flex; justify-content: space-between; padding: 15px 5%; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 10; }
.logo-admin { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.logo-admin img { height: 40px; border-radius: 50%; border: 2px solid white; }
.user-badge { background: white; color: var(--cor-destaque); width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }

/* Área Principal do Admin */
.admin-main-content { flex: 1; padding: 30px 5%; overflow-y: auto; background: var(--bg-cinza-claro); }
.content-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.content-top h1 { color: var(--texto-preto); font-size: 24px; margin: 0; font-weight: 800;}

/* Botão Azul */
.btn-primary-blue { background: var(--cor-destaque); color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; display: flex; gap: 8px; align-items: center; transition: 0.2s; }
.btn-primary-blue:hover { background: var(--cor-hover); transform: translateY(-2px); }

/* Tabela do Admin */
.admin-card-table { background: white; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); overflow-x: auto; padding: 15px; border: 1px solid var(--borda);}
.admin-table-clean { width: 100%; border-collapse: collapse; min-width: 500px; }
.admin-table-clean th { text-align: left; padding: 15px; color: #666; text-transform: uppercase; font-size: 12px; border-bottom: 2px solid var(--borda); }
.admin-table-clean td { padding: 15px; border-bottom: 1px solid var(--borda); font-size: 14px; vertical-align: middle; }
.txt-center { text-align: center; }

/* Menu Lateral / Inferior */
.admin-nav-bar { background: white; display: flex; justify-content: space-around; padding: 10px 0; border-top: 1px solid var(--borda); z-index: 10; box-shadow: 0 -2px 10px rgba(0,0,0,0.02); }
.nav-link { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #888; font-size: 10px; text-decoration: none; padding: 5px 10px; border-radius: 6px; transition: 0.2s; }
.nav-link i { font-size: 18px; }
.nav-link.active { color: var(--cor-destaque); font-weight: bold; }

/* Desktop View do Admin */
@media (min-width: 768px) {
    .admin-wrapper { flex-direction: row; flex-wrap: wrap; }
    .admin-header-clean { width: 100%; order: 1; }
    .admin-nav-bar { width: 220px; height: calc(100vh - 70px); order: 2; flex-direction: column; justify-content: flex-start; padding: 20px 0; border-top: none; border-right: 1px solid var(--borda); }
    .nav-link { flex-direction: row; font-size: 14px; padding: 15px 25px; border-radius: 0; border-left: 3px solid transparent; justify-content: flex-start; gap: 15px; }
    .nav-link i { font-size: 16px; width: 20px; text-align: center; }
    .nav-link.active { background: #f0f4f8; border-left-color: var(--cor-destaque); }
    .nav-link:hover:not(.active) { background: #f8fafc; }
    .admin-main-content { width: calc(100% - 220px); order: 3; height: calc(100vh - 70px); }
}

/* --- ESTILOS DO NOVO DASHBOARD --- */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.dash-card { background: white; padding: 25px; border-radius: 12px; border: 1px solid var(--borda); display: flex; align-items: center; gap: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); transition: 0.3s; }
.dash-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.06); }
.dash-icon { width: 60px; height: 60px; border-radius: 12px; background: #e0f2fe; color: #0284c7; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.dash-info h3 { font-size: 13px; color: #666; text-transform: uppercase; margin: 0 0 5px 0; font-weight: 700; }
.dash-info h2 { font-size: 28px; margin: 0; color: var(--texto-preto); font-weight: 900; }

.dashboard-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.dash-action-box { background: white; padding: 30px 20px; text-align: center; border-radius: 12px; border: 1px dashed #ccc; cursor: pointer; transition: 0.2s; }
.dash-action-box i { font-size: 32px; margin-bottom: 15px; }
.dash-action-box h4 { margin: 0 0 5px 0; font-size: 16px; color: var(--texto-preto); }
.dash-action-box p { margin: 0; font-size: 13px; color: #888; }
.dash-action-box:hover { background: #f8fafc; border-color: var(--cor-destaque); border-style: solid; }

/* ==========================================
   NOVO LAYOUT DO PAINEL ADMINISTRATIVO E MENU
   ========================================== */
.admin-layout { display: flex; min-height: 100vh; background-color: #f4f6f9; }

/* MENU LATERAL ESCURO */
.admin-sidebar { width: 260px; background-color: #0f172a; color: white; display: flex; flex-direction: column; transition: 0.3s; }
.sidebar-logo { padding: 25px 20px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }

/* 👇 A CORREÇÃO DA LOGO AQUI 👇 */
.sidebar-logo img { width: 45px; height: 45px; border-radius: 50%; border: 2px solid white; object-fit: contain; background: white; }
.sidebar-logo span { font-weight: 800; font-size: 18px; letter-spacing: 0.5px; }

/* Links do Menu Lateral */
.sidebar-nav { padding: 20px 0; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 15px; padding: 15px 25px; color: #94a3b8; text-decoration: none; font-weight: 600; transition: 0.2s; border-left: 4px solid transparent; }
.nav-item i { width: 20px; text-align: center; font-size: 18px; }
.nav-item:hover { background-color: rgba(255,255,255,0.05); color: white; }
.nav-item.active { background-color: rgba(255,255,255,0.1); color: white; border-left-color: #25D366; }

/* Selo de "Novo" no menu */
.badge-novo { background: #e63946; color: white; font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: bold; margin-left: auto; }

/* Botão de Sair no rodapé do menu */
.btn-sair { background: none; border: none; border-top: 1px solid rgba(255,255,255,0.1); color: #ff6b6b; padding: 20px; text-align: left; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 15px; display: flex; align-items: center; gap: 10px;}
.btn-sair:hover { background: rgba(255,0,0,0.1); color: #ff5252; }

/* ÁREA PRINCIPAL E TOPO BRANCO */
.admin-main { flex: 1; display: flex; flex-direction: column; overflow-x: hidden; }
.admin-header { background: white; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
.admin-header h2 { font-size: 22px; color: var(--texto-preto); font-weight: 800; margin: 0; }
.admin-user-info { display: flex; align-items: center; gap: 15px; }
.admin-user-info span { font-size: 14px; color: #666; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--cor-destaque); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 18px;}
.admin-content { padding: 40px; }

/* ==========================================
   MODAL DE CADASTRO (Janela Flutuante)
   ========================================== */
.modal-admin-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(4px); 
    display: flex; align-items: center; justify-content: center; z-index: 2000; 
}
.modal-admin-content { 
    background: white; padding: 30px; border-radius: 12px; 
    width: 90%; max-width: 600px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); 
    max-height: 90vh; overflow-y: auto; 
    animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 2px solid #f1f5f9; padding-bottom: 15px; }
.modal-header h3 { margin: 0; color: var(--texto-preto); font-size: 20px; font-weight: 800;}
.btn-fechar { background: none; border: none; font-size: 28px; cursor: pointer; color: #94a3b8; transition: 0.2s;}
.btn-fechar:hover { color: #ef4444; }

.input-grid-admin { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.input-grid-admin .input-group label { font-size: 12px; color: #64748b; font-weight: bold; margin-bottom: 5px;}
.input-grid-admin .input-group select { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; background: #fafafa;}
.input-grid-admin .input-group textarea { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; background: #fafafa; resize: vertical;}

.btn-salvar-modal { 
    background: #25D366; color: white; border: none; padding: 16px; 
    border-radius: 8px; width: 100%; font-weight: 800; cursor: pointer; 
    margin-top: 25px; font-size: 15px; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-salvar-modal:hover { background: #1eaf53; transform: translateY(-2px); }

@media (max-width: 600px) { .input-grid-admin { grid-template-columns: 1fr; } .input-grid-admin .input-group { grid-column: span 1 !important; } }

/* ==========================================
   ESTILOS DA TABELA DE ESTOQUE E AÇÕES
   ========================================== */

/* Barra Superior (Busca e Botão Novo) */
.table-header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }

.search-box-admin { position: relative; display: flex; align-items: center; }
.search-box-admin input { width: 350px; padding: 12px 15px 12px 40px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; outline: none; transition: 0.3s; background: white;}
.search-box-admin input:focus { border-color: #25D366; box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1); }

.btn-novo-produto { background: #25D366; color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: 800; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2); }
.btn-novo-produto:hover { background: #1eaf53; transform: translateY(-2px); }

/* A Tabela Profissional */
.table-responsive { background: white; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); overflow-x: auto; border: 1px solid #e2e8f0; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 800px; text-align: left; }
.admin-table th { background: #f8fafc; padding: 15px 20px; font-size: 12px; font-weight: 800; color: #64748b; text-transform: uppercase; border-bottom: 2px solid #e2e8f0; }
.admin-table td { padding: 15px 20px; border-bottom: 1px solid #f1f5f9; font-size: 14px; color: #334155; vertical-align: middle; }
.admin-table tr:hover { background: #f8fafc; }

/* 👇 DOMANDO A IMAGEM GIGANTE 👇 */
.td-img { width: 50px; height: 50px; object-fit: contain; border-radius: 6px; border: 1px solid #e2e8f0; background: white; padding: 2px; }

/* Botões de Editar e Excluir */
.acoes-flex { display: flex; gap: 8px; }
.btn-edit, .btn-delete { border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: 0.2s; display: flex; align-items: center; gap: 5px; }
.btn-edit { background: #eff6ff; color: #3b82f6; font-weight: bold;}
.btn-edit:hover { background: #3b82f6; color: white; }
.btn-delete { background: #fef2f2; color: #ef4444; font-weight: bold;}
.btn-delete:hover { background: #ef4444; color: white; }

/* Responsividade para o Celular */
@media (max-width: 768px) {
    .table-header-actions { flex-direction: column; align-items: stretch; }
    .search-box-admin input { width: 100%; }
    .btn-novo-produto { justify-content: center; padding: 15px;}
}

/* ==========================================
   CORREÇÃO DE LAYOUT E SCROLL
   ========================================== */
.admin-layout { 
    display: flex; 
    height: 100vh; /* Trava a altura na tela para o menu ficar fixo */
    overflow: hidden; 
    background-color: #f4f6f9; 
}

.admin-main { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    overflow-y: auto; /* ✅ LIBERA O SCROLL APENAS NA ÁREA DE CONTEÚDO */
    background-color: #f4f6f9;
    position: relative;
}

.admin-content { 
    padding: 30px 40px; 
    padding-bottom: 100px; /* Espaço extra no final para o scroll não cortar */
}

/* Garante que a tabela não quebre o layout */
.table-responsive { 
    width: 100%;
    background: white; 
    border-radius: 12px; 
    border: 1px solid #e2e8f0;
    overflow-x: auto; /* Scroll horizontal se a tabela for muito larga */
}