/* =========================================
   1. CONFIGURAÇÕES GERAIS E VARIÁVEIS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700;800&display=swap');

:root {
    --magenta: #F06277;
    --ciano: #01B9B9;
    --preto: #050505;
    --preto-fosco: #0a0a0a;
    --cinza-escuro: #111;
    --borda: #222;
    --branco: #ffffff;
    --gradiente-main: linear-gradient(90deg, var(--magenta) 0%, var(--ciano) 100%);
    --sombra-neon: 0 0 15px rgba(240, 98, 119, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--preto) !important;
    color: var(--branco);
    font-family: 'Sora', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   1.5. ILUMINAÇÃO VIP (CONTRASTE PARA O ADMIN TODO)
   ========================================= */
label, .form-label, .form-label-vip {
    color: #FFFFFF !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    letter-spacing: 1.2px !important;
    margin-bottom: 10px !important;
    display: block !important;
    opacity: 1 !important;
}

::placeholder { color: #aaaaaa !important; opacity: 1 !important; }
:-ms-input-placeholder { color: #aaaaaa !important; }
::-ms-input-placeholder { color: #aaaaaa !important; }

/* =========================================
   2. COMPONENTES GERAIS (BOTÕES, INPUTS)
   ========================================= */
.btn-gradiente {
    background: var(--gradiente-main);
    color: var(--branco) !important;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-flex; align-items: center; gap: 10px; justify-content: center;
    font-size: 0.9rem;
}
.btn-gradiente:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 5px 20px rgba(240, 98, 119, 0.4); 
}

.status-badge { padding: 5px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: bold; }
.status-ativo { background: rgba(0, 255, 136, 0.15); color: #00ff88; border: 1px solid #00ff88; }
.status-inativo { background: rgba(255, 68, 68, 0.15); color: #ff4444; border: 1px solid #ff4444; }

.form-control, input[type="text"], input[type="password"], input[type="email"], select, textarea, .form-select {
    width: 100%; padding: 15px; 
    background: var(--cinza-escuro) !important; 
    border: 1px solid var(--borda) !important;
    color: #FFFFFF !important; 
    border-radius: 10px; outline: none; font-size: 1rem; font-family: 'Sora', sans-serif;
    font-weight: 600 !important;
    transition: 0.3s; height: 55px !important;
}
.form-control:focus, select:focus, textarea:focus, .form-select:focus { 
    border-color: var(--ciano) !important; box-shadow: 0 0 15px rgba(1, 185, 185, 0.2) !important; 
}
select option { background: var(--preto); color: white; }

/* =========================================
   3. LAYOUT ADMIN (SIDEBAR E CONTEÚDO VIP)
   ========================================= */
.admin-wrapper { display: flex; min-height: 100vh; width: 100%; position: relative; }

/* Sidebar Inteligente (Fixa Desktop) */
.sidebar { 
    width: 280px; background: var(--preto-fosco); border-right: 1px solid var(--borda); 
    padding: 25px; display: flex; flex-direction: column; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000; position: fixed; height: 100vh; left: 0; top: 0;
}

.sidebar-header { margin-bottom: 40px; text-align: center; }
.sidebar-logo img { max-width: 150px; height: auto; margin: 0 auto; }

.sidebar-menu { display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.sidebar-menu a { 
    color: #888; padding: 14px 20px; display: flex; align-items: center; gap: 15px;
    border-radius: 12px; font-weight: 700; font-size: 0.95rem; transition: 0.3s;
}
.sidebar-menu a i { font-size: 1.4rem; width: 24px; text-align: center; }
.sidebar-menu a:hover, .sidebar-menu a.active { 
    background: rgba(1, 185, 185, 0.1); color: var(--ciano); box-shadow: inset 4px 0 0 var(--ciano);
}
.sidebar-menu a.sair { color: var(--magenta); margin-top: auto; border-top: 1px solid #222; padding-top: 25px; }

/* Botão Hambúrguer Inteligente (Escondido no PC) */
.mobile-toggle { 
    display: none; position: fixed; top: 20px; left: 20px; z-index: 2100;
    background: var(--gradiente-main); color: white; border: none;
    width: 48px; height: 48px; border-radius: 12px; font-size: 1.8rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5); cursor: pointer;
}

/* O Conteúdo adapta-se à largura da Sidebar */
.main-content { 
    flex: 1; margin-left: 280px; padding: 40px; transition: all 0.4s ease; width: calc(100% - 280px);
}

/* Cards de Estatísticas */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card { 
    background: var(--cinza-escuro); padding: 25px; border-radius: 16px; border: 1px solid var(--borda); 
    display: flex; align-items: center; gap: 20px; transition: 0.3s;
}
.stat-card:hover { border-color: var(--ciano); transform: translateY(-5px); }
.stat-icon { font-size: 2.5rem; color: var(--magenta); }

/* Tabelas Admin */
.table-container { 
    background: var(--cinza-escuro); border-radius: 16px; border: 1px solid var(--borda); 
    overflow-x: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
}
.custom-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.custom-table th { 
    background: #151515; color: var(--ciano); padding: 18px; text-align: left; 
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #333; 
}
.custom-table td { padding: 18px; border-bottom: 1px solid var(--borda); color: #ddd; vertical-align: middle; }
.custom-table tbody tr { transition: 0.2s; cursor: pointer; }
.custom-table tbody tr:hover { background: #1f1f1f; }

/* =========================================
   4. CLIENTE & LOGIN (MOBILE FIRST)
   ========================================= */
.vip-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    border: 1px solid #333; border-radius: 20px; padding: 30px 20px;
    position: relative; overflow: hidden; box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    text-align: center; border-top: 2px solid var(--magenta); margin-bottom: 25px;
}
.vip-card::after {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(1,185,185,0.08) 0%, transparent 60%); pointer-events: none;
}

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 0 25px; }
.menu-item { 
    background: var(--cinza-escuro); padding: 25px 15px; border-radius: 16px; border: 1px solid var(--borda); 
    text-align: center; color: white; transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.menu-item:active { transform: scale(0.98); background: #181818; }
.menu-icon { font-size: 1.8rem; margin-bottom: 5px; }

.vip-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 25px; background: rgba(5,5,5,0.95); backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--borda);
}

/* =========================================
   5. RESPONSIVIDADE RADICAL
   ========================================= */
@media (max-width: 992px) {
    /* ADMIN */
    .sidebar { left: -280px; } /* Oculta Sidebar por padrão */
    .main-content { margin-left: 0; width: 100%; padding: 100px 20px 40px; }
    .mobile-toggle { display: flex; align-items: center; justify-content: center; } /* Mostra Botão Hamburger */
    
    /* Quando Botão Hambúrguer for clicado */
    .admin-wrapper.sidebar-active .sidebar { left: 0; }
    .admin-wrapper.sidebar-active .main-content { opacity: 0.2; pointer-events: none; }

    .stats-grid { grid-template-columns: 1fr; }

    /* SITE CLIENTE */
    header { padding: 15px 20px; }
}

/* =========================================
   6. CORREÇÃO FLATPICKR (CALENDÁRIO DARK VIP)
   ========================================= */
.flatpickr-calendar, .flatpickr-calendar.dark { background: #111 !important; border: 1px solid #333 !important; box-shadow: 0 10px 30px rgba(0,0,0,0.8) !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months { color: #fff !important; background: #1a1a1a !important; font-weight: 800 !important; padding: 2px; border-radius: 5px; }
.flatpickr-current-month input.cur-year { color: var(--ciano) !important; font-weight: 900 !important; }
.flatpickr-day { color: #ccc !important; }
.flatpickr-day.selected { background: var(--ciano) !important; border-color: var(--ciano) !important; color: #000 !important; font-weight: 900 !important; }
.flatpickr-day:hover { background: #333 !important; border-color: #444 !important; color: white !important; }
span.flatpickr-weekday { color: var(--magenta) !important; font-weight: 800 !important; }

/* =========================================
   7. MÓDULO DE CONFIGURAÇÕES VIP
   ========================================= */
.settings-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; align-items: start; }
@media (max-width: 992px) { .settings-grid { grid-template-columns: 1fr; } }

.settings-box { background: #111; border: 1px solid #222; border-radius: 15px; padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.settings-box-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #222; padding-bottom: 15px; margin-bottom: 25px; }
.settings-box-title { font-size: 1.1rem; font-weight: 900; text-transform: uppercase; display: flex; align-items: center; gap: 10px; margin: 0; }
.settings-box-title.yellow { color: #f1c40f; }
.settings-box-title.cyan { color: var(--ciano); }
.settings-box-title.magenta { color: var(--magenta); }

/* Navegação em Pílulas (Igual aos Relatórios) */
.nav-pills-master { background: #111; padding: 8px; border-radius: 50px; display: inline-flex; border: 1px solid #222; margin-bottom: 30px; justify-content: center; flex-wrap: wrap; gap: 5px; }
.nav-pills-master a { color: #888; border-radius: 50px; padding: 12px 25px; font-weight: 800; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; transition: 0.3s; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-pills-master a:hover { color: white; background: #1a1a1a; }
.nav-pills-master a.active { background: var(--gradiente-main); color: white; box-shadow: 0 5px 15px rgba(240, 98, 119, 0.3); }

/* Inputs Escuros */
.form-group-set { margin-bottom: 20px; }
.form-group-set label { display: block; color: white; font-size: 0.8rem; margin-bottom: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.form-control-set { width: 100%; padding: 12px 15px; border-radius: 8px; background: #151515; border: 1px solid #333; color: white; outline: none; font-weight: 600; transition: 0.3s; }
.form-control-set:focus { border-color: var(--ciano); background: #0a0a0a; box-shadow: 0 0 10px rgba(1, 185, 185, 0.2); }

/* =========================================
   8. MÓDULO DE COMPRAS E FORNECEDORES VIP
   ========================================= */

/* Cabeçalho do Módulo */
.admin-header-compras { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #222; padding-bottom: 20px; margin-bottom: 30px; }
.admin-header-compras h1 { margin: 0; font-size: 1.8rem; color: var(--ciano); font-weight: 900; letter-spacing: -1px; }
.admin-header-compras h1 span { color: white; }

/* Botões de Ação VIP */
.btn-add-vip { background: var(--ciano); color: #000; border: none; padding: 12px 25px; border-radius: 8px; font-weight: 900; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: 0.3s; text-transform: uppercase; }
.btn-add-vip:hover { background: white; box-shadow: 0 0 15px rgba(1, 185, 185, 0.4); }

.action-btn-vip { display: inline-flex; justify-content: center; align-items: center; width: 35px; height: 35px; border-radius: 8px; color: white; cursor: pointer; border: none; transition: 0.2s; background: #222; border: 1px solid #333; }
.action-btn-vip:hover { background: var(--ciano); color: black; border-color: var(--ciano); }
.action-btn-vip.btn-del:hover { background: var(--magenta); color: white; border-color: var(--magenta); }

/* ✨ CORREÇÃO DA BADGE DE PAGO (FLEXBOX ALINHADO) ✨ */
.badge-status-vip { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 6px;
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 0.75rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    white-space: nowrap;
}
.badge-ativo { background: rgba(0, 255, 136, 0.1); color: #00ff88; border: 1px solid #00ff88; }
.badge-inativo { background: rgba(255, 68, 68, 0.1); color: #ff4444; border: 1px solid #ff4444; }

/* Modal Escuro VIP */
.modal-overlay-vip { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 10000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content-vip { background: #111; width: 90%; max-width: 700px; padding: 30px; border-radius: 15px; border: 1px solid #333; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close-vip { position: absolute; top: 15px; right: 20px; font-size: 1.8rem; color: #888; cursor: pointer; transition: 0.2s; }
.modal-close-vip:hover { color: var(--magenta); }

/* Formulários do Módulo */
.form-group-vip { margin-bottom: 15px; }
.form-group-vip label { display: block; color: white; font-size: 0.8rem; margin-bottom: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;}
.form-control-vip-dark { width: 100%; padding: 12px 15px; border-radius: 8px; background: #1a1a1a; border: 1px solid #333; color: white; outline: none; font-weight: 600; font-size: 1rem; transition: 0.3s;}
.form-control-vip-dark:focus { border-color: var(--ciano); box-shadow: 0 0 10px rgba(1, 185, 185, 0.2); }

/* =========================================
   FORÇA A PÁGINA A USAR 100% NA IMPRESSÃO
   ========================================= */
@media print {
    body, .admin-wrapper { background: white !important; }
    .sidebar { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; }
    .no-print { display: none !important; }
}