:root {
    --bg-body: #f4f6f9;
    --text-main: #1d1d1f;
    --sidebar-bg: #000000;
    --sidebar-text: #b3b3b3;
    --accent: #cc0000;
    --accent-hover: #990000;
    --success: #34c759;
    --error: #ff3b30;
    --sidebar-width: 250px;
    --header-height: 65px;
    --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 1. RESET GLOBAL & TRAVAMENTO DO BODY */
* { margin: 0; padding: 0; box-sizing: border-box; outline: none; text-decoration: none; list-style: none; -webkit-tap-highlight-color: transparent; }

body { 
    background-color: var(--bg-body); 
    font-family: var(--font-stack); 
    color: var(--text-main); 
    height: 100vh; 
    width: 100vw; 
    overflow: hidden; /* TRAVA O SCROLL GERAL (CRUCIAL) */
}

/* Customização para Desktop Native App */

/* 1. Esconde a scrollbar padrão do navegador e coloca uma estilo Apple (fina e elegante) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F5F5F7;
}

::-webkit-scrollbar-thumb {
    background: #D1D1D6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8E8E93;
}

/* 2. Impede que o usuário selecione textos do menu ou ícones (Native App Feeling) */
.sidebar, .top-bar, .seg-btn, .btn-action-primary, .order-id {
    user-select: none;
    -webkit-user-select: none;
}

/* 3. Remove o destaque azul ao clicar em botões no Chrome/Edge */
button, a {
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
}

/* 4. Ajuste de espaçamento para janelas Standalone (Desktop) */
@media all and (display-mode: standalone) {
    body {
        -webkit-app-region: drag; /* Permite arrastar a janela por áreas vazias se quiser */
    }
    .main-content, button, input, select, a {
        -webkit-app-region: no-drag; /* Botões e inputs funcionam normal */
    }
}

/* Scrollbar Estilizada */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ANIMAÇÃO */
@keyframes slideUpFade { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
.anime-entry { animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* ================= LOGIN ================= */
.login-container { display: flex; width: 100%; height: 100vh; background: #fff; overflow-y: auto; }
.login-image { width: 60%; background-image: url('../images/login-bg.webp'); background-size: cover; background-position: center; position: relative; }
.login-image::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.3); }
.login-form-wrapper { width: 40%; display: flex; align-items: center; justify-content: center; padding: 2rem; position: relative; z-index: 2; }
.form-box { width: 100%; max-width: 380px; }
.form-header h2 { font-size: 2.2rem; margin-bottom: 0.5rem; color: #000; font-weight: 700; letter-spacing: -0.5px; }
.form-header p { color: #86868b; margin-bottom: 2rem; font-size: 1rem; }
.input-group { position: relative; margin-bottom: 1.5rem; }
.input-group label { display: block; margin-bottom: 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #86868b; letter-spacing: 0.5px; }
.input-group input { width: 100%; padding: 14px 45px 14px 15px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 1rem; background: #fafafa; transition: var(--transition); color: #1d1d1f; }
.input-group input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(204,0,0,0.08); }
.toggle-password { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); height: 30px; width: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #86868b; z-index: 10; }
.toggle-password i { font-size: 1.1rem; }
.toggle-password:hover { color: #000; }
@media (min-width: 901px) { .toggle-password { top: 62%; transform: translateY(-50%); } }
.actions { display: flex; align-items: center; margin-bottom: 2rem; font-size: 0.95rem; color: #1d1d1f; }
.actions input { margin-right: 10px; accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.btn-login { width: 100%; padding: 16px; background: #000; color: #fff; border: none; border-radius: 8px; font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: var(--transition); border-bottom: 3px solid var(--accent); }
.btn-login:hover { background: #1d1d1f; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }

/* MOBILE LOGIN */
@media (max-width: 900px) {
    .login-container { flex-direction: column; background: transparent; }
    .login-image { display: none; }
    .login-form-wrapper { width: 100%; height: 100vh; padding: 20px; align-items: center; background: transparent; }
    .form-box { width: 100%; max-width: 400px; }
    .form-header h2 { font-size: 2.5rem; letter-spacing: -1px; margin-bottom: 5px; color: #000; }
    .form-header p { font-size: 1.1rem; color: #6e6e73; margin-bottom: 30px; }
    .input-group { margin-bottom: 15px; }
    .input-group label { display: none; }
    .input-group input { background: #FFFFFF; border: none; border-radius: 12px; padding: 16px 45px 16px 20px; font-size: 0.8rem; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
    .input-group input:focus { transform: scale(1.01); box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
    .toggle-password { top: 50%; transform: translateY(-50%); right: 15px; }
    .actions { justify-content: flex-start; margin-top: 10px; margin-bottom: 25px; padding-left: 5px; color: #6e6e73; }
    .actions input { width: 20px; height: 20px; border-radius: 6px; }
    .btn-login { border-radius: 50px; padding: 18px; font-size: 1.2rem; border-bottom: none; box-shadow: 0 5px 20px rgba(0,0,0,0.2); }
}

/* ================= TOAST ================= */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 12001; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #fff; padding: 16px 24px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); display: flex; align-items: center; gap: 12px; border-left: 5px solid #333; transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); min-width: 280px; }
.toast.show { transform: translateX(0); }
.toast.success { border-left-color: var(--success); } .toast.success i { color: var(--success); font-size: 1.2rem; }
.toast.error { border-left-color: var(--error); } .toast.error i { color: var(--error); font-size: 1.2rem; }
.toast span { font-weight: 600; font-size: 0.95rem; color: #1d1d1f; }

/* ================= ESTRUTURA DO SISTEMA (LAYOUT FIXO) ================= */

/* Sidebar Fixa */
.sidebar { 
    width: var(--sidebar-width); 
    background: var(--sidebar-bg); 
    color: var(--sidebar-text); 
    position: fixed; 
    top: 0; left: 0; 
    height: 100vh; /* Altura total */
    z-index: 1000; 
    display: flex; flex-direction: column; 
    transition: transform var(--transition); 
    border-right: 1px solid #222; 
}
.sidebar-header { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 1.2rem; font-weight: 800; color: #fff; border-bottom: 1px solid #1a1a1a; flex-shrink: 0; }
.brand-title span { color: var(--accent); }
.sidebar-close-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; display: none; transition: 0.3s; }
.sidebar-close-btn:hover { color: var(--accent); transform: rotate(90deg); }
.sidebar-menu { flex: 1; padding: 20px 0; overflow-y: auto; }
.menu-item a { display: flex; align-items: center; padding: 12px 25px; color: #aaa; transition: 0.2s; font-size: 0.95rem; border-left: 3px solid transparent; }
.menu-item a:hover, .menu-item a.active { background: #111; color: #fff; border-left-color: var(--accent); }
.menu-item i { width: 25px; margin-right: 10px; text-align: center; }

/* Overlay Mobile */
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 900; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(2px); }
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* AREA PRINCIPAL (Main Content) */
.main-content { 
    margin-left: var(--sidebar-width); 
    width: calc(100% - var(--sidebar-width)); 
    height: 100vh; /* Altura total da tela */
    display: flex; 
    flex-direction: column; /* Organiza Topo e Conteúdo verticalmente */
    transition: margin var(--transition); 
    overflow: hidden; /* Garante que nada vaze */
}

/* Top Bar (Cabeçalho Fixo) */
.top-bar { 
    height: var(--header-height); 
    flex: 0 0 auto; /* NÃO encolhe nem cresce. Fica fixo. */
    background: #fff; 
    border-bottom: 1px solid #e0e0e0; 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 25px; 
    z-index: 90; 
}

/* SEARCH & USER DROPDOWN */
.search-container { position: relative; width: 300px; }
.search-box { position: relative; width: 100%; }
.search-box i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #999; }
.search-box input { width: 100%; padding: 10px 15px 10px 40px; border: 1px solid #eee; background: #f8f8f8; border-radius: 20px; font-size: 0.9rem; transition: 0.3s; }
.search-box input:focus { background: #fff; border-color: var(--accent); }
.search-dropdown { position: absolute; top: 110%; left: 0; width: 100%; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid #eee; padding: 10px 0; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 1002; }
.search-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.search-result-item { display: flex; align-items: center; padding: 10px 20px; color: #333; font-size: 0.9rem; transition: 0.2s; cursor: pointer; }
.search-result-item:hover { background: #f9f9f9; color: var(--accent); padding-left: 25px; }
.search-result-item i { margin-right: 10px; color: #999; }
.search-no-result { padding: 15px; text-align: center; color: #999; font-size: 0.85rem; }
.user-area { position: relative; cursor: pointer; }
.user-avatar { width: 38px; height: 38px; background: #000; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; border: 2px solid transparent; transition: 0.3s; }
.user-avatar:hover { border-color: var(--accent); }
.dropdown-menu { position: absolute; top: 55px; right: 0; width: 200px; background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.1); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transition); overflow: hidden; border: 1px solid rgba(0,0,0,0.05); }
.dropdown-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: block; padding: 14px 20px; color: #333; font-size: 0.95rem; border-bottom: 1px solid #f9f9f9; }
.dropdown-item:hover { background: #f5f5f7; color: var(--accent); }

/* CONTENT WRAPPER (ONDE O SCROLL ACONTECE) */
.content-wrapper { 
    flex: 1; /* Ocupa todo o espaço restante abaixo do Top Bar */
    overflow-y: auto; /* HABILITA SCROLL AQUI */
    overflow-x: hidden;
    padding: 30px; 
}

/* Dashboard Cards */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card { background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.02); border-top: 3px solid transparent; transition: 0.3s; }
.card:hover { transform: translateY(-5px); border-top-color: var(--accent); }
.card h3 { font-size: 0.85rem; color: #86868b; margin-bottom: 10px; font-weight: 600; text-transform: uppercase; }
.card .number { font-size: 2rem; font-weight: 700; color: #1d1d1f; letter-spacing: -1px; }

/* Mobile Toggle */
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 6px; }
.mobile-toggle span { width: 28px; height: 2px; background: #000; transition: 0.3s; border-radius: 2px; }
.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); background: var(--accent); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); background: var(--accent); }

/* ================= PAGINA PRODUTOS ================= */
.products-view { width: 100%; position: relative; }

.category-selector { display: flex; gap: 20px; width: 100%; transition: 0.4s ease; }
.category-card { flex: 1; min-height: 280px; background: #fff; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.03); transition: 0.3s; border: 2px solid transparent; position: relative; overflow: hidden; }
.category-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: var(--accent); }
.category-card h3 { font-size: 1.8rem; font-weight: 800; margin-top: 15px; color: #1d1d1f; z-index: 2; }
.category-card i { font-size: 3.5rem; color: var(--accent); z-index: 2; transition: 0.3s; }
.category-card:hover i { transform: scale(1.1); }
.category-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(204,0,0,0.02) 0%, rgba(255,255,255,0) 70%); z-index: 1; }

.product-list-container { display: none; opacity: 0; transform: translateY(20px); transition: 0.4s ease; }

.list-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; background: #fff; padding: 15px 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); flex-wrap: wrap; }
.btn-back { background: #f0f0f0; border: none; padding: 10px 15px; border-radius: 10px; cursor: pointer; font-weight: 600; color: #1d1d1f; display: flex; align-items: center; gap: 5px; transition: 0.2s; font-size: 0.9rem; }
.btn-back:hover { background: #e5e5ea; }
.list-title-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 150px; }
.list-title-wrapper h3 { font-size: 1.2rem; font-weight: 700; color: #000; }
.list-title-wrapper span { font-size: 0.8rem; color: #888; }
.prod-search-wrapper { position: relative; width: 250px; }
.prod-search-wrapper i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #999; }
.prod-search-wrapper input { width: 100%; padding: 10px 10px 10px 35px; border: 1px solid #eee; background: #f9f9f9; border-radius: 8px; font-size: 0.9rem; }
.btn-add-new { background: #000; color: #fff; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.2s; white-space: nowrap; }
.btn-add-new:hover { background: #333; transform: translateY(-1px); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.prod-card { background: #fff; border-radius: 16px; padding: 15px; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: 0.3s; border: 1px solid #f0f0f0; }
.prod-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.06); }
.img-wrapper { position: relative; width: 100%; }
.prod-img { width: 100%; height: 160px; background: #f9f9f9; border-radius: 10px; margin-bottom: 12px; object-fit: cover; }
.stock-badge { position: absolute; top: 8px; left: 8px; padding: 4px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.stock-ok { background: var(--success); }
.stock-low { background: #ffcc00; color: #333; }
.stock-out { background: #000; color: #fff; }
.prod-info h4 { font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; color: #1d1d1f; }
.unit-badge { background: #f0f0f0; color: #666; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.prod-info p { font-size: 0.85rem; color: #86868b; margin-bottom: 8px; line-height: 1.3; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prod-price { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.action-menu { position: absolute; bottom: 15px; right: 15px; }
.btn-dots { background: transparent; border: none; font-size: 1.1rem; color: #999; cursor: pointer; padding: 5px; width: 30px; height: 30px; border-radius: 50%; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-dots:hover { background: #f0f0f0; color: #000; }
.action-dropdown { position: absolute; bottom: 100%; right: 0; background: #fff; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); width: 130px; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.2s; z-index: 10; border: 1px solid #eee; }
.action-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.action-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 15px; border: none; background: #fff; text-align: left; cursor: pointer; font-size: 0.85rem; color: #333; transition: 0.2s; text-decoration: none; }
.action-item:hover { background: #f5f5f7; }
.action-item.delete:hover { color: var(--error); background: #fff0f0; }

/* ================= MODAIS (COM ANIMAÇÃO CLEAN) ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0); /* Começa transparente */
    z-index: 12000;
    backdrop-filter: blur(0px); /* Começa sem blur */
    display: none; /* Controlado pelo JS */
    align-items: center; justify-content: center;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

/* Estado Ativo do Overlay */
.modal-overlay.active {
    display: flex;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

/* Estado de Saída (Closing) */
.modal-overlay.closing {
    background: rgba(0,0,0,0);
    backdrop-filter: blur(0px);
}

/* Container do Modal */
.modal-content {
    background: #fff; width: 90%; max-width: 600px;
    border-radius: 20px; 
    /* Remove padding direto daqui para o scroll não vazar */
    padding: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    /* Altura máxima segura */
    max-height: 85vh; 
    position: relative;
    overflow: hidden; /* Garante que nada saia das bordas redondas */
    display: flex; flex-direction: column;
    
    /* Estado Inicial */
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Quando Ativo */
.modal-overlay.active .modal-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Quando Fechando */
.modal-overlay.closing .modal-content {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
}

/* Header Fixo */
.modal-header { 
    padding: 20px 30px; 
    border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; 
    background: #fff; z-index: 2;
}
.modal-header h3 { font-size: 1.5rem; font-weight: 700; color: #000; }
.modal-close { background: transparent; border: none; font-size: 1.5rem; color: #999; cursor: pointer; transition: 0.2s; }
.modal-close:hover { color: var(--error); transform: rotate(90deg); }

/* Corpo com Scroll ESTILIZADO */
.modal-body-scroll {
    overflow-y: auto;
    padding: 30px; /* Padding movido para cá */
    flex: 1; /* Ocupa espaço restante */
    
    /* Scrollbar interna elegante (Loja Style) */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) #f1f1f1;
}

/* Scrollbar do Modal (WebKit - Chrome/Safari) */
.modal-body-scroll::-webkit-scrollbar { width: 6px; }
.modal-body-scroll::-webkit-scrollbar-track { background: #f1f1f1; }
.modal-body-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.modal-body-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Footer Fixo */
.modal-actions {
    padding: 20px 30px; 
    border-top: 1px solid #eee; background: #fff; 
    display: flex; justify-content: flex-end; gap: 15px; z-index: 2;
}
.btn-cancel { background: #f0f0f0; color: #333; padding: 12px 25px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; }
.btn-save { background: #000; color: #fff; padding: 12px 25px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; }
.btn-save:hover { background: #333; }

/* Modal Pequeno (Confirmação) */
.modal-confirm { max-width: 400px; text-align: center; }
.modal-confirm .modal-body-scroll { padding: 30px; overflow: hidden; /* Confirmação não precisa scroll */ } 
.modal-confirm i { font-size: 3rem; color: var(--error); margin-bottom: 15px; }
.modal-confirm h3 { margin-bottom: 10px; }
.modal-confirm p { color: #666; margin-bottom: 25px; }
.btn-confirm-delete { background: var(--error); color: #fff; padding: 12px 25px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; }

/* Form Elements */
.form-row { display: flex; gap: 20px; margin-bottom: 15px; }
.form-col { flex: 1; }
.modal-label { display: block; font-size: 0.85rem; font-weight: 600; color: #555; margin-bottom: 8px; }
.modal-input, .modal-select, .modal-textarea { 
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; 
    font-size: 0.95rem; background: #fafafa; transition: 0.2s; 
}
.modal-input:focus, .modal-select:focus, .modal-textarea:focus { background: #fff; border-color: var(--accent); }
.modal-textarea { resize: vertical; min-height: 80px; }
.upload-area { border: 2px dashed #ddd; padding: 20px; text-align: center; border-radius: 10px; cursor: pointer; transition: 0.2s; position: relative; }
.upload-area:hover { border-color: var(--accent); background: #fff9f9; }
.upload-preview { max-height: 150px; display: none; margin: 10px auto; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.upload-label { color: #888; font-size: 0.9rem; pointer-events: none; }

/* SITE EDITOR */
.btn-mini-add { background: #000; color: #fff; border: none; padding: 8px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }

/* LISTA SLIDES */
.sortable-list { display: flex; flex-direction: column; gap: 10px; }
.sortable-item { 
    display: flex; align-items: center; gap: 15px; background: #fff; border: 1px solid #eee; 
    padding: 10px; border-radius: 8px; cursor: grab; transition: box-shadow 0.2s;
}
.sortable-item:active { cursor: grabbing; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.drag-handle { color: #ccc; cursor: grab; padding: 5px; font-size: 1.2rem; }
.item-thumb { width: 100px; height: 60px; object-fit: cover; border-radius: 4px; background: #eee; }
.item-info { flex: 1; }
.item-info h4 { margin: 0; font-size: 0.95rem; color: #333; }
.badge { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-weight: 700; text-transform: uppercase; display: inline-block; margin-top: 4px; }
.badge.active { background: #e8f5e9; color: #2e7d32; }
.badge.inactive { background: #ffebee; color: #c62828; }

.item-actions button { background: #f5f5f5; border: 1px solid #eee; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; color: #555; transition: 0.2s; margin-left: 5px; }
.item-actions button:hover { background: #e0e0e0; color: #000; border-color: #ccc; }
.item-actions .btn-del:hover { background: #ffebee; color: #c62828; border-color: #ffcdd2; }

/* GRID CATEGORIAS SITE */
.sortable-list.grid-mode { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.grid-item { 
    display: flex; flex-direction: column; border: 1px solid #eee; border-radius: 8px; 
    overflow: hidden; background: #fff; position: relative; padding: 0; 
}
.grid-img { height: 120px; width: 100%; background: #f9f9f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.grid-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-placeholder { font-size: 2rem; color: #ddd; }
.grid-info { padding: 10px; text-align: center; }
.grid-info h4 { font-size: 0.9rem; margin: 0; font-weight: 700; }
.grid-info small { font-size: 0.7rem; color: #999; }
.grid-actions { display: flex; justify-content: center; gap: 8px; padding-bottom: 12px; }
.grid-actions button { background: #f5f5f5; border: 1px solid #eee; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: #555; }
.drag-handle-abs { position: absolute; top: 5px; right: 5px; background: rgba(255,255,255,0.9); padding: 6px; border-radius: 4px; cursor: grab; z-index: 2; color: #333; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }


/* ================= MOBILE RESPONSIVO (CORRIGIDO) ================= */
@media (max-width: 900px) {
    /* 1. Travar o corpo */
    body { overflow: hidden; }

    /* 2. Sidebar Mobile (75% + Sem sombra inativa) */
    .sidebar { width: 75%; transform: translateX(-100%); box-shadow: none; }
    .sidebar.active { transform: translateX(0); box-shadow: 5px 0 30px rgba(0,0,0,0.5); }
    .sidebar-close-btn { display: block; } 

    /* 3. Estrutura Fixa vs Scrollavel */
    .main-content { margin-left: 0; width: 100%; height: 100vh; display: flex; flex-direction: column; }

    /* 4. Top Bar Fixa */
    .top-bar { flex: 0 0 auto; padding: 0 20px; z-index: 50; }

    /* 5. Conteúdo Scrollavel */
    .content-wrapper { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px; padding-bottom: 80px; -webkit-overflow-scrolling: touch; }

    /* Esconder busca */
    .mobile-toggle { display: flex; }
    .search-container { display: none; }

    /* --- AJUSTE DA NOTIFICAÇÃO (TOAST) PARA MOBILE --- */
    .toast-container { right: 15px; left: 15px; width: auto; top: 75px;}
    .toast { min-width: unset; width: 100%; }

    /* Produtos */
    .category-selector { flex-direction: column; gap: 20px; }
    .category-card { width: 100%; height: 200px; flex: none; }
    
    .list-header { flex-direction: column; align-items: stretch; gap: 15px; padding: 15px; }
    .list-title-wrapper { text-align: center; }
    .prod-search-wrapper { width: 100%; }
    .btn-add-new { justify-content: center; }
    

    .prod-card { display: flex; gap: 15px; align-items: flex-start; padding: 15px; }
    .prod-img { width: 90px; height: 90px; margin-bottom: 0; flex-shrink: 0; }
    .prod-info { flex: 1; padding-right: 30px; }
    .action-menu { bottom: auto; top: 10px; right: 5px; }
    
    .form-row { flex-direction: column; gap: 10px; }

    /* SITE EDITOR MOBILE (CORRIGIDO) */
    .sortable-item { 
        flex-direction: column; align-items: flex-start; position: relative; 
        padding-bottom: 50px; 
    }
    .item-thumb { width: 100%; height: 150px; margin-bottom: 10px; }
    .item-info { width: 100%; padding-right: 0; margin-bottom: 5px; }
    
    /* Botões Flutuantes no Card (CORRIGIDO: VISÍVEIS E CLICÁVEIS) */
    .item-actions { 
        position: absolute; bottom: 10px; right: 10px;
        display: flex; gap: 10px; z-index: 5;
    }
    .item-actions button {
        width: 40px; height: 40px; font-size: 1.1rem;
        background: #f9f9f9; border: 1px solid #ddd;
    }

    /* Grid Categorias Mobile */
    .sortable-list.grid-mode { grid-template-columns: 1fr; }
    .grid-item { margin-bottom: 15px; height: auto; display: flex; flex-direction: column; position: relative; padding-bottom: 50px; }
    .grid-img { height: 150px; width: 100%; }
    .grid-info { text-align: left; padding: 15px; }
    
    /* Botões Flutuantes Categorias (CORRIGIDO) */
    .grid-actions { 
        position: absolute; bottom: 10px; right: 10px;
        display: flex; gap: 10px; justify-content: flex-end; width: auto; padding: 0; z-index: 5;
    }
    .grid-actions button { width: 40px; height: 40px; font-size: 1.1rem; }
    
    /* Handle de arrastar maior */
    .drag-handle { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.9); padding: 8px; border-radius: 4px; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
    .drag-handle-abs { top: 10px; left: 10px; right: auto; padding: 8px; font-size: 1.2rem; opacity: 0.9; }
}