/* ==================================================
   CodeTecVance CRM
   app.css
   Módulo 1 - Base do Sistema
================================================== */


/* RESET */

*{

    margin:0;
    padding:0;
    box-sizing:border-box;

}


:root{

    --primary:#ea5e2a;
    --primary-dark:#c44d1f;

    --dark:#141323;
    --dark-light:#181c3c;

    --background:#f3f4f6;

    --white:#ffffff;

    --text:#1f2937;

    --border:#e5e7eb;

    --shadow:0 5px 20px rgba(0,0,0,.08);

}



/* CORPO */

body{

    font-family:Arial, Helvetica, sans-serif;

    background:var(--background);

    color:var(--text);

}



/* CONTAINER PRINCIPAL */

#app{

    display:flex;

    min-height:100vh;

}



/* ==================================================
   SIDEBAR
================================================== */


#sidebar{

    width:260px;

    background:var(--dark);

    color:white;

    height:100vh;

    position:fixed;

    left:0;

    top:0;

    overflow-y:auto;

    overflow-x:hidden;

}



.brand{

    text-align:center;

    padding:30px 20px;

    border-bottom:1px solid rgba(255,255,255,.1);

}



.brand img{

    width:80px;

    height:80px;

    object-fit:contain;

    margin-bottom:15px;

}



.brand h1{

    font-size:22px;

}



.brand span{

    color:#9ca3af;

    font-size:14px;

}



/* MENU */

.menu{

    padding:20px 10px;

}



.menu-item{

    width:100%;

    border:none;

    background:none;

    color:#d1d5db;

    padding:15px;

    text-align:left;

    border-radius:8px;

    cursor:pointer;

    font-size:15px;

    display:flex;

    align-items:center;

    gap:12px;

    margin-bottom:8px;

    transition:.3s;

}



.menu-item:hover{

    background:var(--dark-light);

    color:white;

}



.menu-item.active{

    background:var(--primary);

    color:white;

}





/* ==================================================
   ÁREA PRINCIPAL
================================================== */


#main{

    margin-left:260px;

    width:calc(100% - 260px);

    padding:30px;

}





/* TOPO */

.topbar{

    background:white;

    padding:25px;

    border-radius:12px;

    box-shadow:var(--shadow);

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:30px;

}



.topbar h2{

    font-size:28px;

    margin-bottom:5px;

}



.topbar p{

    color:#6b7280;

}



.user{

    background:#141323;

    color:#ea5e2a;

    padding:12px 20px;

    border-radius:20px;

    font-weight:bold;

}



/* ==================================================
   CONTEÚDO
================================================== */


#content{

    min-height:500px;

}



/* LOADING */

.loading{

    background:white;

    padding:40px;

    border-radius:12px;

    text-align:center;

    box-shadow:var(--shadow);

}





/* ==================================================
   CARDS PADRÃO
================================================== */


.cards{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:20px;

}



.card{

    background:white;

    padding:25px;

    border-radius:12px;

    box-shadow:var(--shadow);

}



.card h3{

    font-size:15px;

    color:#6b7280;

    margin-bottom:15px;

}



.card strong{

    font-size:30px;

    color:var(--primary);

}
/* ==================================================
    TABELAS
================================================== */


.table-box{

    background:white;

    padding:25px;

    border-radius:12px;

    box-shadow:var(--shadow);

    overflow-x:auto;

}




table{

    width:100%;

    border-collapse:collapse;

    table-layout:fixed;

    word-break:break-word;

}




th{

    background:#f9fafb;

    text-align:left;

    padding:14px;

    border-bottom:1px solid var(--border);

}




td{

    padding:14px;

    border-bottom:1px solid var(--border);

}




.data-table th{

    font-size:13px;

    color:#6b7280;

    text-transform:uppercase;

    letter-spacing:.5px;

}






/* ==================================================
    LOGIN PAGE
================================================== */


.login-page{

    display:flex;

    justify-content:center;

    align-items:center;

    min-height:100vh;

    padding:20px;

}




.login-container{

    background:white;

    padding:40px;

    border-radius:16px;

    box-shadow:var(--shadow);

    width:100%;

    max-width:420px;

}




.login-header{

    text-align:center;

    margin-bottom:35px;

}




.login-logo{

    width:70px;

    height:70px;

    object-fit:contain;

    margin-bottom:15px;

}




.login-header h1{

    font-size:24px;

    margin-bottom:5px;

}




.login-header p{

    color:#6b7280;

}




.login-form .form-group{

    margin-bottom:20px;

}




.login-form label{

    display:block;

    margin-bottom:6px;

    font-weight:600;

    font-size:14px;

    color:#374151;

}




.login-form input{

    width:100%;

    padding:12px 14px;

    border:2px solid var(--border);

    border-radius:8px;

    font-size:15px;

    transition:.3s;

    outline:none;

}




.login-form input:focus{

    border-color:var(--primary);

}




.login-error{

    background:#fef2f2;

    color:#dc2626;

    padding:12px;

    border-radius:8px;

    margin-bottom:15px;

    font-size:14px;

}




.login-footer{

    text-align:center;

    margin-top:30px;

    color:#9ca3af;

    font-size:13px;

}






/* ==================================================
    CADASTROS - TABS
================================================== */


/* ==================================================
    CADASTROS PAGE
================================================== */

.cadastros-page{

    max-height:calc(100vh - 130px);

    overflow-y:auto;

    overflow-x:hidden;

}

.dashboard-header{

    display:flex;

    justify-content:space-between;

    align-items:flex-start;

    margin-bottom:25px;

}

.dashboard-header h2{

    font-size:22px;

    margin:0 0 4px;

}

.dashboard-header p{

    color:#6b7280;

    margin:0;

}

.table-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:15px;

}

.table-header h3{

    font-size:15px;

    color:#6b7280;

}

.tabs{

    display:flex;

    gap:8px;

    margin-bottom:25px;

    border-bottom:2px solid var(--border);

    padding-bottom:10px;

}




.tab{

    padding:10px 24px;

    border:none;

    background:none;

    cursor:pointer;

    font-size:15px;

    color:#6b7280;

    border-bottom:3px solid transparent;

    margin-bottom:-2px;

    transition:.3s;

}




.tab:hover{

    color:var(--primary);

}




.tab.active{

    color:var(--primary);

    border-bottom-color:var(--primary);

    font-weight:bold;

}




.tab-content{

    display:none;

}




.tab-content.active{

    display:block;

}





/* ==================================================
    LOGIN OVERLAY
================================================== */


#loginOverlay{

    position:fixed;

    top:0;

    left:0;

    width:100%;

    height:100%;

    background:var(--background);

    display:flex;

    justify-content:center;

    align-items:center;

    z-index:9999;

}

.password-change-box{

    background:white;

    padding:25px;

    border-radius:12px;

    box-shadow:var(--shadow);

    margin-bottom:25px;

    border-left:4px solid #f59e0b;

}

.password-change-box .form-group{

    margin-bottom:15px;

}

.password-change-box label{

    display:block;

    margin-bottom:6px;

    font-weight:600;

    font-size:14px;

    color:#374151;

}

.password-change-box input{

    width:100%;

    padding:10px 12px;

    border:2px solid var(--border);

    border-radius:8px;

    font-size:14px;

    outline:none;

}

.password-change-box input:focus{

    border-color:var(--primary);

}





.password-change-box{

    background:white;

    padding:25px;

    border-radius:12px;

    box-shadow:var(--shadow);

    margin-bottom:25px;

    border-left:4px solid #f59e0b;

}





.password-change-box .form-group{

    margin-bottom:15px;

}





.password-change-box label{

    display:block;

    margin-bottom:6px;

    font-weight:600;

    font-size:14px;

    color:#374151;

}





.password-change-box input{

    width:100%;

    padding:10px 12px;

    border:2px solid var(--border);

    border-radius:8px;

    font-size:14px;

    outline:none;

}





.password-change-box input:focus{

    border-color:var(--primary);

}






/* ==================================================
    RESPONSIVO
================================================== */


@media(max-width:900px){


    #sidebar{

        width:80px;

    }


    .brand h1,

    .brand span,

    .menu-item{

        font-size:0;

    }


    .menu-item{

        justify-content:center;

    }


    #main{

        margin-left:80px;

        width:calc(100% - 80px);

    }


    .cards{

        grid-template-columns:repeat(2,1fr);

    }


}



@media(max-width:600px){


    .cards{

        grid-template-columns:1fr;

    }

.topbar{

    flex-direction:column;

    gap:20px;

    align-items:flex-start;

}



}





/* ==================================================
    MODAL SYSTEM
================================================== */


.modal-overlay{

    position:fixed;

    top:0;

    left:0;

    width:100%;

    height:100%;

    background:rgba(0,0,0,.5);

    display:flex;

    justify-content:center;

    align-items:center;

    z-index:10000;

    padding:20px;

}




.modal-card{

    background:white;

    border-radius:16px;

    box-shadow:0 20px 60px rgba(0,0,0,.2);

    width:100%;

    max-width:520px;

    max-height:90vh;

    overflow-y:auto;

    animation:modalIn .2s ease;

}




@keyframes modalIn{

    from{

        opacity:0;

        transform:translateY(-20px) scale(.96);

    }

    to{

        opacity:1;

        transform:translateY(0) scale(1);

    }

}




.modal-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:20px 25px;

    border-bottom:1px solid var(--border);

}




.modal-header h3{

    font-size:18px;

    margin:0;

}




.modal-close{

    background:none;

    border:none;

    font-size:22px;

    cursor:pointer;

    color:#9ca3af;

    padding:4px 8px;

    border-radius:6px;

    transition:.2s;

    line-height:1;

}




.modal-close:hover{

    background:#f3f4f6;

    color:var(--text);

}




.modal-body{

    padding:25px;

}




.modal-footer{

    display:flex;

    justify-content:flex-end;

    gap:10px;

    padding:15px 25px;

    border-top:1px solid var(--border);

}




.form-group{

    margin-bottom:18px;

}




.form-group label{

    display:block;

    margin-bottom:6px;

    font-weight:600;

    font-size:13px;

    color:#374151;

}




.form-group input,

.form-group select,

.form-group textarea{

    width:100%;

    padding:10px 14px;

    border:2px solid var(--border);

    border-radius:8px;

    font-size:14px;

    transition:.3s;

    outline:none;

    font-family:inherit;

}




.form-group input:focus,

.form-group select:focus,

.form-group textarea:focus{

    border-color:var(--primary);

}




.form-group select{

    background:white;

    cursor:pointer;

}




.form-row{

    display:flex;

    gap:15px;

}




.form-row .form-group{

    flex:1;

}






/* ==================================================
    TOAST NOTIFICATIONS
================================================== */


.toast-container{

    position:fixed;

    top:20px;

    right:20px;

    z-index:20000;

    display:flex;

    flex-direction:column;

    gap:10px;

}




.toast{

    padding:14px 22px;

    border-radius:10px;

    box-shadow:0 8px 30px rgba(0,0,0,.15);

    color:white;

    font-size:14px;

    font-weight:500;

    animation:toastIn .3s ease, toastOut .3s ease 2.7s forwards;

    max-width:380px;

}




@keyframes toastIn{

    from{

        opacity:0;

        transform:translateX(60px);

    }

    to{

        opacity:1;

        transform:translateX(0);

    }

}




@keyframes toastOut{

    from{

        opacity:1;

        transform:translateX(0);

    }

    to{

        opacity:0;

        transform:translateX(60px);

    }

}




.toast-success{

    background:#10b981;

}




.toast-error{

    background:#ef4444;

}




.toast-info{

    background:#3b82f6;

}






/* ==================================================
    BUTTONS — Professional
================================================== */


.btn{

    background:var(--primary);

    color:white;

    border:none;

    padding:10px 20px;

    border-radius:8px;

    cursor:pointer;

    transition:.3s;

    font-size:14px;

    font-weight:600;

    display:inline-flex;

    align-items:center;

    gap:6px;

}




.btn:hover{

    background:var(--primary-dark);

}




.btn-small{

    background:#6b7280;

    color:white;

    padding:6px 12px;

    border-radius:6px;

    font-size:12px;

    border:none;

    cursor:pointer;

    font-weight:600;

}




.btn-small:hover{

    background:#4b5563;

}




.btn-sm{

    padding:6px 14px;

    font-size:13px;

    border-radius:6px;

}




.btn-danger{

    background:#ef4444;

}




.btn-danger:hover{

    background:#dc2626;

}




.btn-success{

    background:#10b981;

}




.btn-success:hover{

    background:#059669;

}




.btn-outline{

    background:transparent;

    border:2px solid var(--border);

    color:var(--text);

}




.btn-outline:hover{

    border-color:var(--primary);

    color:var(--primary);

    background:transparent;

}




.btn-icon{

    background:none;

    border:none;

    cursor:pointer;

    padding:6px 10px;

    border-radius:6px;

    font-size:16px;

    transition:.2s;

    color:#6b7280;

}




.btn-icon:hover{

    background:#f3f4f6;

}




.btn-icon-danger:hover{

    background:#fef2f2;

    color:#ef4444;

}




.btn-full{

    width:100%;

    justify-content:center;

}




.btn:disabled{

    opacity:.5;

    cursor:not-allowed;

}





/* ==================================================
    DATA TABLES — Professional
================================================== */


.data-table{

    width:100%;

    border-collapse:collapse;

    table-layout:fixed;

}




.data-table thead th{

    background:#f9fafb;

    text-align:left;

    padding:12px 14px;

    font-size:12px;

    font-weight:700;

    color:#6b7280;

    text-transform:uppercase;

    letter-spacing:.5px;

    border-bottom:2px solid var(--border);

}




.data-table tbody td{

    padding:12px 14px;

    border-bottom:1px solid var(--border);

    font-size:14px;

    vertical-align:middle;

}




.data-table tbody tr:hover{

    background:#f9fafb;

}




.data-table .actions{

    display:flex;

    gap:4px;

    justify-content:flex-end;

}





/* ==================================================
    CARDS — Professional
================================================== */


.card{

    background:white;

    padding:25px;

    border-radius:12px;

    box-shadow:var(--shadow);

}




.card h3{

    font-size:15px;

    color:#6b7280;

    margin-bottom:15px;

}




.card strong{

    font-size:30px;

    color:var(--primary);

}





/* ==================================================
    BADGES
================================================== */


.badge{

    display:inline-block;

    padding:3px 10px;

    border-radius:20px;

    font-size:11px;

    font-weight:700;

    text-transform:uppercase;

    letter-spacing:.3px;

}




.badge-admin{

    background:#fef3c7;

    color:#92400e;

}




.badge-funcionario{

    background:#dbeafe;

    color:#1e40af;

}




.badge-ativo{

    background:#d1fae5;

    color:#065f46;

}




.badge-inativo{

    background:#fee2e2;

    color:#991b1b;

}

/* DATABASE PAGE */

.database-page .cards .card strong{
    font-size:28px;
}

.database-page #dbTabs .tab{
    font-size:12px;
    padding:8px 14px;
    white-space:nowrap;
}

.database-page #dbTabs .tab.active{
    background:var(--primary);
    color:white;
    border-radius:6px;
    border-bottom:none;
}

/* PRODUTOS PAGE */

.produtos-page .data-table td{
    font-size:13px;
}

/* CAIXA RELATORIOS DIARIOS */

#relatoriosDiarios .data-table{
    font-size:12px;
}

#relatoriosDiarios .data-table th{
    font-size:11px;
}

/* VENDAS PAGE */

.vendas-caixa-status{
    background:#fef2f2;
    border:2px solid #ef4444;
    color:#dc2626;
    padding:20px 24px;
    border-radius:12px;
    font-size:16px;
    font-weight:bold;
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:24px;
}

.vendas-layout{
    display:flex;
    gap:20px;
    min-height:600px;
}

.vendas-left{
    flex:1;
    min-width:0;
}

.vendas-right{
    width:420px;
    min-width:380px;
    background:white;
    border-radius:12px;
    box-shadow:var(--shadow);
    display:flex;
    flex-direction:column;
    max-height:calc(100vh - 200px);
}

.vendas-cart-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:16px 20px;
    border-bottom:1px solid var(--border);
}

.vendas-cart-header h3{
    margin:0;
    font-size:16px;
}

.vendas-cart-items{
    flex:1;
    overflow-y:auto;
    padding:12px 16px;
}

.vendas-cart-empty{
    text-align:center;
    color:#9ca3af;
    padding:40px 20px;
    font-size:14px;
}

.vendas-cart-item{
    padding:10px 0;
    border-bottom:1px solid #f3f4f6;
}

.vendas-cart-item:last-child{
    border-bottom:none;
}

.vendas-cart-item-info{
    display:flex;
    justify-content:space-between;
    margin-bottom:6px;
}

.vendas-cart-item-nome{
    font-weight:600;
    font-size:14px;
}

.vendas-cart-item-preco{
    color:#6b7280;
    font-size:13px;
}

.vendas-cart-item-actions{
    display:flex;
    align-items:center;
    gap:8px;
}

.vendas-cart-item-qtd{
    font-weight:bold;
    font-size:15px;
    min-width:24px;
    text-align:center;
}

.vendas-cart-item-subtotal{
    margin-left:auto;
    font-weight:bold;
    color:var(--primary);
    font-size:14px;
}

.vendas-cart-summary{
    padding:16px 20px;
    border-top:1px solid var(--border);
    background:#f9fafb;
}

.vendas-cart-summary-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:8px;
    font-size:14px;
    color:#6b7280;
}

.vendas-cart-summary-total{
    display:flex;
    justify-content:space-between;
    font-size:20px;
    font-weight:bold;
    color:var(--text);
    padding-top:8px;
    border-top:2px solid var(--border);
}

.vendas-cart-actions{
    padding:16px 20px;
    border-top:1px solid var(--border);
}

/* Produtos grid */

.vendas-produtos-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
    gap:12px;
    max-height:calc(100vh - 320px);
    overflow-y:auto;
    padding-right:8px;
}

.vendas-produto-card{
    background:white;
    border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,.06);
    padding:14px;
    cursor:pointer;
    transition:.2s;
    border:2px solid transparent;
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
}

.vendas-produto-card:hover{
    border-color:var(--primary);
    box-shadow:0 4px 16px rgba(234,94,42,.12);
    transform:translateY(-2px);
}

.vendas-produto-sem-estoque{
    opacity:.5;
    cursor:not-allowed;
}

.vendas-produto-img{
    width:80px;
    height:80px;
    object-fit:contain;
    border-radius:8px;
    margin-bottom:10px;
    background:#f9fafb;
}

.vendas-produto-img-placeholder{
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;
    background:#f9fafb;
}

.vendas-produto-info{
    width:100%;
}

.vendas-produto-nome{
    font-weight:600;
    font-size:13px;
    margin-bottom:4px;
    line-height:1.3;
}

.vendas-produto-sku{
    font-size:11px;
    color:#9ca3af;
    margin-bottom:6px;
}

.vendas-produto-preco{
    font-size:18px;
    font-weight:bold;
    color:var(--primary);
    margin-bottom:4px;
}

.vendas-produto-estoque{
    font-size:11px;
}

.vendas-produto-add{
    position:absolute;
    top:8px;
    right:8px;
    width:28px;
    height:28px;
    border-radius:50%;
    background:var(--primary);
    color:white;
    border:none;
    font-size:18px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:.2s;
}

.vendas-produto-add:hover{
    transform:scale(1.15);
}

/* Pagamento rows */

.vendas-pagamento-row{
    display:flex;
    gap:6px;
    align-items:center;
    margin-bottom:6px;
}

/* Responsivo vendas */

@media(max-width:1000px){
    .vendas-layout{
        flex-direction:column;
    }
    .vendas-right{
        width:100%;
        min-width:0;
        max-height:none;
    }
    .vendas-produtos-grid{
        max-height:none;
    }
}

/* ============================================================
   IMPRESSÃO — CONFIGURAÇÕES PROFISSIONAIS
   ============================================================ */

.impressao-layout{
    display:grid;
    grid-template-columns:1fr 380px;
    gap:20px;
}

.impressao-config{
    padding-right:20px;
    border-right:1px solid var(--border);
}

.impressao-secao{
    border:1px solid var(--border);
    border-radius:10px;
    padding:14px 16px;
    margin-bottom:14px;
    background:#fafafa;
}

.impressao-secao > h4{
    margin:0 0 12px;
    font-size:13px;
    font-weight:700;
    color:#111827;
    display:flex;
    align-items:center;
    gap:8px;
    padding-bottom:8px;
    border-bottom:1px dashed var(--border);
}

.impressao-checks{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px 16px;
    margin-top:10px;
}

.impressao-checks label{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:12.5px;
    color:#374151;
    font-weight:500;
    cursor:pointer;
}

.impressao-checks input[type="checkbox"]{
    width:15px;
    height:15px;
    accent-color:var(--primary);
    cursor:pointer;
}

/* Pré-visualização do cupom */

.cupom-preview-box{
    position:sticky;
    top:0;
}

.cupom-preview-box .table-header{
    border-radius:10px 10px 0 0;
}

.cupom-preview{
    background:#e5e7eb;
    padding:16px;
    border-radius:0 0 10px 10px;
    display:flex;
    justify-content:center;
}

.cupom-preview .cupom-doc{
    width:100%;
    max-width:310px;
    background:#fff;
    box-shadow:0 8px 24px rgba(0,0,0,.18);
    border-radius:3px;
    overflow:hidden;
}

.cupom-preview .cupom-corpo{
    padding:8px 10px;
    font-family:'Courier New', monospace;
    font-size:10.5px;
    color:#000;
    line-height:1.35;
}

.cupom-preview .cp-center{ text-align:center; }
.cupom-preview .cp-linha{ display:flex; justify-content:space-between; }
.cupom-preview .cp-tt{ text-align:center; font-weight:bold; }
.cupom-preview .cp-div{ border-top:1px dashed #000; margin:4px 0; }
.cupom-preview .cp-item{ display:flex; justify-content:space-between; font-weight:bold; }
.cupom-preview .cp-item-sub{ display:flex; justify-content:space-between; font-size:9px; }
.cupom-preview .cp-total{ text-align:right; font-size:14px; font-weight:bold; margin:5px 0; }
.cupom-preview .cp-forte{ font-weight:bold; }
.cupom-preview .cp-pequeno{ font-size:8.5px; }
.cupom-preview .cp-qrcode{ display:flex; justify-content:center; margin:6px 0; }
.cupom-preview .cp-obs{ font-size:9px; text-align:center; }

/* Etiquetas */

.etiqueta-checks{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px 16px;
    margin-top:10px;
}

.etiqueta-checks label{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:12.5px;
    color:#374151;
    font-weight:500;
    cursor:pointer;
}

.etiqueta-checks input[type="checkbox"]{
    width:15px;
    height:15px;
    accent-color:var(--primary);
    cursor:pointer;
}

@media(max-width:1200px){
    .impressao-layout{
        grid-template-columns:1fr;
    }
    .impressao-config{
        border-right:none;
        padding-right:0;
    }
    .cupom-preview-box{
        position:static;
    }
}



