/* css/global.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary: #38bdf8;
    --bg: #0f172a;
    --bg-darker: #020617;
    --card: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --nav-width-closed: 70px;
    --nav-width-open: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR (NAV) --- */
nav {
    width: var(--nav-width-closed);
    background-color: var(--bg-darker);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 0;
}

nav:hover {
    width: var(--nav-width-open);
}

nav .logo-img {
    width: 35px;
    margin: 0 auto 20px;
    display: block;
    transition: 0.3s;
}

nav h2 {
    color: var(--primary);
    font-size: 18px;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    margin-bottom: 30px;
    transition: 0.3s;
}

nav:hover h2 { opacity: 1; }

nav ul { list-style: none; width: 100%; padding: 0 10px; }

nav ul li a {
    display: flex;
    align-items: center;
    height: 50px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: 0.2s;
    white-space: nowrap;
}

/* Centraliza os emojis quando o menu está fechado */
nav ul li a i, nav ul li a span:first-child {
    min-width: 50px;
    text-align: center;
    font-size: 20px;
}

/* Esconde o texto quando o menu está fechado */
nav ul li a span:last-child {
    opacity: 0;
    transition: 0.3s;
    margin-left: 10px;
}

nav:hover ul li a span:last-child { opacity: 1; }

nav ul li a:hover {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.btn-sair {
    margin-top: auto;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 50px;
    padding-left: 15px;
}

/* --- CONTEÚDO PRINCIPAL --- */
main, .pdv-main {
    flex: 1;
    margin-left: var(--nav-width-closed);
    padding: 30px;
    transition: margin-left 0.3s;
}

/* --- RESPONSIVIDADE (MOBILE) --- */
@media (max-width: 768px) {
    nav {
        width: 100% !important;
        height: 70px;
        bottom: 0;
        top: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 0;
    }

    nav h2, nav .logo-img { display: none; }

    nav ul {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0;
        height: 100%;
    }

    nav ul li { margin: 0; }
    
    /* No mobile só mostra o ícone para não amontoar */
    nav ul li a span:last-child { display: none; }
    
    nav ul li a {
        flex-direction: column;
        justify-content: center;
        height: 100%;
    }

    main, .pdv-main {
        margin-left: 0 !important;
        margin-bottom: 80px; /* Espaço para o menu de baixo */
        padding: 15px;
    }
    
    .btn-sair { display: none; } /* Oculto no mobile para poupar espaço */
}