/* =========================================
   1. IMPORTAÇÃO DE FONTES & VARIÁVEIS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:wght@400;600;700&display=swap');

:root {
    /* Paleta de Cores - Identidade Visual "Meu Kit Certo" */
    --bg-body: #F9F7F2;      /* Bege Claro Sofisticado */
    --bg-card: #FFFFFF;      /* Branco Puro */
    
    --primary: #4A3B32;      /* Marrom Café (Principal) */
    --primary-hover: #3E2C26; /* Marrom Escuro (Hover) */
    
    --accent: #C5A059;       /* Dourado Elegante (Detalhes) */
    
    --text-main: #3E2C26;    /* Texto Escuro Suave */
    --text-light: #8D8075;   /* Texto Secundário (Cinza Quente) */
    --border: #EAE5D9;       /* Bordas Sutis */
    
    /* Cores Funcionais (Status) */
    --success: #27AE60;
    --success-bg: #E8F6EE;
    --warning: #F39C12;
    --warning-bg: #FEF5E7;
    --danger: #C0392B;
    --danger-bg: #F9EBEB;
}

/* =========================================
   2. RESET & BASE
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

body { 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 400;
    display: flex; 
    min-height: 100vh; 
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; color: var(--primary); font-weight: 700; }
a { text-decoration: none; }

/* =========================================
   3. SIDEBAR (MENU LATERAL)
   ========================================= */
.sidebar { 
    width: 260px; 
    background: var(--bg-card); 
    padding: 30px 20px; 
    border-right: 1px solid var(--border); 
    position: fixed; 
    height: 100%; 
    z-index: 1000;
    box-shadow: 5px 0 20px rgba(74, 59, 50, 0.03);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.logo-container { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.logo-container img { max-width: 140px; height: auto; display: block; margin: 0 auto; }

.menu-category { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent); margin: 25px 0 10px 15px; font-weight: 600; }

.menu a { 
    display: flex; align-items: center; padding: 12px 20px; color: var(--text-light); 
    border-radius: 8px; margin-bottom: 5px; transition: all 0.3s; font-weight: 500; border-left: 3px solid transparent;
}
.menu a:hover, .menu a.active { 
    background-color: #FAF8F5; color: var(--primary); font-weight: 600; 
    border-left-color: var(--accent); padding-left: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.menu a.logout { color: var(--danger); margin-top: 30px; border: 1px solid transparent; }
.menu a.logout:hover { background: var(--danger-bg); border-left-color: transparent; }

/* =========================================
   4. CONTEÚDO PRINCIPAL & HEADER
   ========================================= */
.main-content { margin-left: 260px; flex: 1; padding: 40px; transition: margin 0.3s ease; width: 100%; }

.header-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 40px; 
}
.header-top h1 { font-size: 1.8rem; letter-spacing: -0.5px; }

/* --- BOTÃO HAMBURGUER (CORRIGIDO - SEM FUNDO/SOMBRA) --- */
.mobile-toggle { 
    display: none; 
    
    /* Ícone Grande e Limpo */
    font-size: 2.2rem; 
    line-height: 1;
    color: var(--primary); 
    
    /* RESET TOTAL DE ESTILO DE BOTÃO */
    background: transparent !important; 
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    
    /* Espaçamento apenas na direita para afastar do texto */
    padding: 0 15px 0 0; 
    margin: 0;
    
    cursor: pointer;
    width: auto !important; 
}

/* Overlay */
.overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(62, 44, 38, 0.6); z-index: 900; 
    opacity: 0; visibility: hidden; transition: all 0.3s; backdrop-filter: blur(3px);
}
.overlay.active { opacity: 1; visibility: visible; }

/* =========================================
   5. CARDS & DASHBOARD
   ========================================= */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 25px; margin-bottom: 40px; }
.card { 
    background: var(--bg-card); padding: 30px; border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(74, 59, 50, 0.06); border: 1px solid rgba(255,255,255,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(74, 59, 50, 0.12); }
.card h3 { font-size: 0.85rem; color: var(--text-light); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.card .value { font-size: 2.2rem; font-weight: 700; color: var(--primary); font-family: 'Playfair Display', serif; }

/* =========================================
   6. FORMULÁRIOS & BOTÕES
   ========================================= */
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--primary); font-size: 0.9rem; }
input, select, textarea { 
    width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 8px; 
    background: #FCFCFA; font-family: 'Montserrat', sans-serif; font-size: 16px; color: var(--text-main); transition: all 0.3s ease;
}
input:focus, select:focus { border-color: var(--accent); background: #FFF; box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15); }

/* Estilo Global de Botões (O .mobile-toggle agora ignora isso) */
button { 
    background: var(--primary); color: #FFF; border: none; cursor: pointer; font-weight: 600; 
    padding: 14px 24px; border-radius: 50px; font-size: 0.95rem; letter-spacing: 0.5px; 
    transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(74, 59, 50, 0.2); width: 100%;
}
button:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(74, 59, 50, 0.3); }
button:active { transform: scale(0.98); }
@media (min-width: 768px) { button { width: auto; min-width: 150px; } }

/* =========================================
   7. TABELAS
   ========================================= */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: transparent; }
th { text-align: left; padding: 15px 20px; color: var(--text-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid var(--border); font-weight: 600; }
td { padding: 20px; border-bottom: 1px solid var(--border); color: var(--text-main); font-size: 0.95rem; background: var(--bg-card); }
tr:first-child td:first-child { border-top-left-radius: 16px; }
tr:first-child td:last-child { border-top-right-radius: 16px; }
tr:last-child td:first-child { border-bottom-left-radius: 16px; }
tr:last-child td:last-child { border-bottom-right-radius: 16px; }

.status-badge { padding: 6px 12px; border-radius: 30px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }
.status-novo { background: #EBF5FB; color: #2980B9; }
.status-producao { background: var(--warning-bg); color: var(--warning); }
.status-pronto { background: var(--success-bg); color: var(--success); }
.status-finalizado { background: #F2F4F6; color: #95A5A6; }

/* =========================================
   8. TELA DE LOGIN & CADASTRO
   ========================================= */
.login-container { 
    display: flex; justify-content: center; align-items: center; min-height: 100vh; width: 100%;
    background-color: var(--bg-body); background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, var(--bg-body) 70%); padding: 15px;
}
.login-box { 
    background: #FFFFFF; padding: 40px 25px; border-radius: 24px; width: 100%; max-width: 400px; 
    text-align: center; box-shadow: 0 20px 40px -10px rgba(74, 59, 50, 0.15), 0 0 0 1px rgba(197, 160, 89, 0.1); 
    position: relative; overflow: hidden;
}
.login-box::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: var(--accent); }

.login-logo { 
    max-width: 280px; max-height: 200px; width: auto; height: auto; 
    display: block; margin: 0 auto 15px auto; object-fit: contain; 
}
.login-title { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--primary); margin-bottom: 5px; font-weight: 700; line-height: 1.2; }
.login-subtitle { font-family: 'Montserrat', sans-serif; font-size: 0.9rem; color: var(--text-light); margin-bottom: 30px; }
.login-box input { background: #FAFAFA; border: 1px solid #E0E0E0; padding: 16px; font-size: 1rem; margin-bottom: 15px; border-radius: 8px; }
.login-box button { margin-top: 10px; padding: 16px; font-size: 1rem; letter-spacing: 1px; text-transform: uppercase; width: 100%; }

/* --- CAPTCHA STYLES (NOVO) --- */
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    background: #FAFAFA;
    border: 1px solid var(--border);
    padding: 5px;
    border-radius: 8px;
}

.captcha-img {
    border-radius: 4px;
    height: 45px;
    cursor: pointer; /* Indica que pode clicar para recarregar */
    border: 1px solid #eee;
}

.captcha-input {
    border: none !important;
    background: transparent !important;
    margin-bottom: 0 !important;
    padding: 10px !important;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    font-size: 1.2rem;
    color: var(--primary) !important;
}

.captcha-input:focus {
    box-shadow: none !important;
}

.captcha-refresh {
    font-size: 1.5rem;
    color: var(--accent);
    cursor: pointer;
    padding: 0 10px;
    transition: transform 0.3s;
}
.captcha-refresh:hover {
    transform: rotate(180deg);
}

/* =========================================
   9. RESPONSIVIDADE (MOBILE)
   ========================================= */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 20px; }
    
    /* Botão Hamburguer Visível */
    .mobile-toggle { display: block; }
    
    /* Cabeçalho Mobile */
    .header-top { 
        flex-wrap: wrap; 
        margin-bottom: 30px;
        align-items: center; 
    }
    
    /* Nome do Usuário */
    .user-greeting {
        width: 100%;
        text-align: center;
        order: 3; 
        margin-top: 15px;
        padding-top: 10px;
        border-top: 1px solid rgba(0,0,0,0.05);
    }
    
    .user-greeting h1 { font-size: 1.3rem; }
    
    /* Badge na direita */
    .status-badge-header { margin-left: auto; }

    /* Ajustes Gerais */
    .card { overflow-x: auto; padding: 20px; }
    table { min-width: 600px; } 
    .card .value { font-size: 1.8rem; }
    
    /* Login Mobile */
    .login-box { padding: 30px 20px; }
    .login-logo { max-width: 85%; max-height: 160px; margin-bottom: 10px; }
    .login-title { font-size: 1.4rem; }
}