/* ============================================================
   CAMARGO SOLUTIONS - ESTILO GLOBAL (LOGIN + PAINEL)
   ============================================================ */

/* 1. IMPORTAR FONTE (POPPINS) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* 2. VARIÁVEIS DE COR E GERAL */
:root {
    --primary: #0d6efd;       /* Azul Principal */
    --primary-dark: #0a58ca;  /* Azul Escuro */
    --secondary: #6c757d;     /* Cinza */
    --success: #198754;       /* Verde */
    --danger: #dc3545;        /* Vermelho */
    --warning: #ffc107;       /* Amarelo */
    --bg-body: #f3f4f6;       /* Fundo da Página */
    --bg-card: #ffffff;       /* Fundo dos Cards */
    --text-main: #1f2937;     /* Texto Principal */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ============================================================
   3. TELA DE LOGIN (DESIGN SPLIT SCREEN)
   ============================================================ */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: white;
}

/* Lado Esquerdo (Imagem) */
.login-side-visual {
    flex: 1.5; /* Ocupa 60% no PC */
    position: relative;
    /* Imagem de Fundo (Escritório) */
    background-image: url('https://images.unsplash.com/photo-1497215728101-856f4ea42174?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 60px;
    color: white;
}

/* Película Azul sobre a imagem */
.login-side-visual::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(37, 99, 235, 0.5), rgba(17, 24, 39, 0.9));
    z-index: 1;
}

.visual-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    animation: fadeInUp 0.8s ease-out;
}

.visual-content h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 15px; line-height: 1.2; }
.visual-content p { font-size: 1.1rem; opacity: 0.9; font-weight: 300; }

/* Lado Direito (Formulário) */
.login-side-form {
    flex: 1; /* Ocupa 40% no PC */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
}

.form-container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 1s ease;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 30px;
}
.brand-logo i { font-size: 2rem; }

.login-title { font-size: 1.8rem; font-weight: 700; color: #111; margin-bottom: 5px; }
.login-subtitle { color: var(--secondary); margin-bottom: 30px; font-size: 0.9rem; }

/* Inputs do Login */
.input-group-custom { margin-bottom: 20px; }
.input-label { display: block; font-size: 0.85rem; font-weight: 600; color: #374151; margin-bottom: 8px; }

.custom-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
    color: #333;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

.custom-input:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.btn-login-pro {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 25px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.btn-login-pro:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Responsividade Login (Mobile) */
@media (max-width: 900px) {
    .login-side-visual { display: none; }
    .login-side-form { flex: 1; padding: 20px; }
    .form-container { padding: 0; }
}

/* ============================================================
   4. PAINEL ADMINISTRATIVO (ESTILOS GERAIS)
   ============================================================ */

/* Topo / Header */
.top-bar { 
    background: var(--primary); 
    padding: 15px 0; 
    margin-bottom: 30px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    color: white;
}

.btn-voltar { 
    color: white; 
    font-weight: 600; 
    display: inline-flex; 
    align-items: center; 
    margin-left: 20px; 
    transition: opacity 0.2s; 
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}
.btn-voltar:hover { opacity: 0.9; color: white; background: rgba(255,255,255,0.2); }
.btn-voltar i { margin-right: 5px; font-size: 1.1rem; }

/* Títulos de Página (Cards com Ícone e Título) */
.page-header-card { 
    background: white; 
    border-radius: var(--radius); 
    padding: 25px; 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    box-shadow: var(--card-shadow); 
    margin-bottom: 30px; 
    border-left: 6px solid var(--primary); 
}
.page-header-card i { font-size: 2.5rem; color: var(--primary); }
.page-header-card h2 { margin: 0; font-weight: 700; color: #111; font-size: 1.6rem; text-transform: uppercase; }

/* Dashboard: Cards de Resumo (Topo) */
.card-resumo-topo {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    border-bottom: 4px solid transparent;
    transition: transform 0.3s;
    height: 100%;
}
.card-resumo-topo:hover { transform: translateY(-5px); }
.card-resumo-topo h3 { font-size: 2rem; font-weight: 800; margin: 10px 0 0 0; }
.card-resumo-topo span { text-transform: uppercase; font-size: 0.75rem; font-weight: 700; color: #888; letter-spacing: 1px; }
.card-resumo-topo i { font-size: 2.5rem; margin-bottom: 10px; }

/* Dashboard: Menu Grid (Ícones Grandes) */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; }
.menu-item {
    background: white;
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}
.menu-item:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(13, 110, 253, 0.15); border-color: var(--primary); color: var(--primary); }
.menu-item i { font-size: 2.5rem; margin-bottom: 10px; color: #333; transition: color 0.3s; }
.menu-item:hover i { color: var(--primary); }
.menu-item h6 { font-weight: 700; margin: 0; font-size: 0.85rem; text-transform: uppercase; }

/* Alerta Vermelho nos Ícones (ex: Estoque Baixo) */
.alerta-badge { 
    position: absolute; top: -5px; right: -5px; 
    background: var(--danger); color: white; 
    padding: 4px 8px; border-radius: 10px; 
    font-size: 0.7rem; font-weight: bold; 
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.4);
}

/* Tabelas */
.table-custom { 
    background: white; 
    border-radius: var(--radius); 
    overflow: hidden; 
    box-shadow: var(--card-shadow); 
    border: none; 
    margin-bottom: 20px;
}
.table-custom thead { background: #f8fafc; }
.table-custom th { 
    padding: 18px 15px; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    color: #64748b; 
    font-weight: 700; 
    border-bottom: 1px solid #e2e8f0; 
}
.table-custom td { 
    padding: 15px; 
    vertical-align: middle; 
    border-bottom: 1px solid #f1f5f9; 
    font-size: 0.95rem; 
    color: #333;
}
.table-custom tr:hover td { background-color: #f9f9f9; }

/* Cards de Filtro (Topo das Listagens) */
.card-filter {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: block;
    height: 100%;
    box-shadow: var(--card-shadow);
    border-bottom: 4px solid transparent;
    position: relative;
    color: inherit;
    transition: transform 0.2s;
    text-decoration: none;
    cursor: pointer;
}
.card-filter:hover { transform: translateY(-3px); }
.card-filter h2 { margin: 0; font-weight: 700; }
.card-filter small { font-weight: 600; text-transform: uppercase; font-size: 0.75rem; color: #888; }

/* Cores das Bordas dos Cards */
.active-blue { border-color: var(--primary); }
.active-green { border-color: var(--success); }
.active-red { border-color: var(--danger); }

/* Ícones de Fundo nos Cards */
.icon-card { 
    position: absolute; 
    right: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    font-size: 3rem; 
    opacity: 0.1; 
}

/* Botões de Ação Principais */
.action-bar { margin-bottom: 30px; }
.btn-modern-action { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 15px; 
    border-radius: var(--radius); 
    font-weight: 700; 
    width: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    cursor: pointer; 
    transition: 0.2s; 
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
    text-decoration: none;
}
.btn-modern-action:hover { 
    background: var(--primary-dark); 
    transform: translateY(-2px); 
    color: white;
}

/* Header do Dashboard (Específico) */
.header-dashboard { 
    background: linear-gradient(135deg, var(--primary), #004494); 
    color: white; 
    padding: 40px 0 80px 0; 
    border-radius: 0 0 30px 30px; 
    margin-bottom: 60px; 
}

/* Badges (Status) */
.badge { padding: 6px 10px; border-radius: 30px; font-size: 0.75rem; font-weight: 600; }

/* Modais */
.modal-header-custom { border-radius: var(--radius); border: none; overflow: hidden; }
.modal-header-custom .modal-header { background: var(--primary); color: white; border-bottom: none; }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* Animações */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Ajuste Global para aplicações de Painel Fixo */
.home-section {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important; /* Trava a rolagem da página inteira */
}

.layout-prod, .layout-rast {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden; /* Garante que o scroll aconteça só na tabela */
}

.table-wrapper {
    flex: 1;
    overflow-y: auto !important; /* Scroll interno na tabela */
    background: white;
    border-radius: var(--radius);
    margin-top: 15px;
}

/* Fixar o topo da tabela ao rolar */
.table-custom thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc; /* Cor de fundo do seu thead */
}