/* ============================= */
/* RESET E TIPOGRAFIA */
/* ============================= */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:"Segoe UI", Roboto, Arial, sans-serif;
}
body{
    background:#f8f9fa;          /* Fundo claro neutro, gov.br style */
    color:#212529;               /* Texto escuro padrão */
    padding-bottom:40px;
}
hr{
    border:none;
    border-top:1px solid #dee2e6;
    margin:25px auto;
    max-width:1100px;
}
h2, h3{
    text-align:center;
    margin:20px 0;
    font-weight:600;
    color:#009739;               /* Verde Brasil nos títulos */
}
.btn-desativado{
    background:#e9ecef;
    color:#6c757d;
    cursor:not-allowed;
    pointer-events:none;
    opacity:0.65;
}
/* ============================= */
/* MENU */
/* ============================= */
.menu{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    padding:15px;
    background:#ffffff;
    border-bottom:1px solid #dee2e6;
    justify-content:center;
}
.menu button{
    border:none;
    padding:10px 18px;
    border-radius:6px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:0.2s;
}
.menu button:hover{
    transform:translateY(-1px);
    box-shadow:0 3px 8px rgba(0,151,57,0.2);  /* Sombra verde suave */
}
/* CORES MENU - Verde Brasil predominante */
.prestador{background:#009739;color:white;}      /* Verde oficial bandeira */
.usuario{background:#0d6efd;color:white;}        /* Azul gov.br para contraste */
.logout{background:#dc3545;color:white;}         /* Vermelho para logout */
/* ============================= */
/* FORMULÁRIO */
/* ============================= */
.form-container{
    background:#F5F5F5;
    max-width:1100px;
    margin:auto;
    padding:25px;
    border-radius:8px;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
    border:1px solid #dee2e6;
}
.form-row{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
    margin-bottom:15px;
}
.form-group{
    flex:1;
    min-width:200px;
    display:flex;
    flex-direction:column;
}
label{
    font-size:13px;
    margin-bottom:5px;
    color:#009739;               /* Labels em verde Brasil */
    font-weight:600;
}
input, select, textarea{
    padding:10px;
    border-radius:6px;
    border:1px solid #ced4da;
    font-size:14px;
    transition:0.2s;
}
input:focus,
select:focus,
textarea:focus{
    outline:none;
    border-color:#009739;
    box-shadow:0 0 0 3px rgba(0,151,57,0.15);
}
textarea{resize:vertical;}
form button[type="submit"]{
    background:#009739;          /* Verde Brasil botão principal */
    color:white;
    border:none;
    padding:12px 20px;
    font-size:15px;
    border-radius:6px;
    cursor:pointer;
    margin-top:10px;
    font-weight:600;
}
form button[type="submit"]:hover{
    background:#00732c;          /* Verde mais escuro hover */
}
/* ============================= */
/* Login */
/* ============================= */
.login-container {
    background:#ffffff;
    padding:30px;
    border-radius:10px;
    box-shadow:0 8px 20px rgba(0,0,0,0.15);
    width:100%;
    max-width:400px;
    text-align:center;
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    border:1px solid #dee2e6;
}
h2 i { margin-right:8px; color:#009739; }
.input-group {
    transition:all .2s ease;
    display:flex;
    align-items:center;
    margin-bottom:15px;
    border:1px solid #ced4da;
    border-radius:5px;
    padding:8px 10px;
    background:#ffffff;
}
.input-group input::placeholder{
    color:#6c757d;
}
.input-group i {
    margin-right:8px;
    color:#009739;
}
.input-group input {
    border:none;
    outline:none;
    flex:1;
    font-size:14px;
    background:transparent;
    color:#212529;
}
.input-group:focus-within{
    border-color:#009739;
    box-shadow:0 0 0 3px rgba(0,151,57,0.2);
}
.input-group:focus-within i{
    color:#00732c;
}
.button-nfse-login {
    background:#009739;
    color:#fff;
    border:none;
    padding:10px 15px;
    border-radius:5px;
    cursor:pointer;
    font-size:15px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:5px;
    width:200px;
    margin:15px auto;
}
.button-nfse-login:hover{
    background:#00732c;
}
.button-nfse-login i{
    margin-right:5px;
}
.g-recaptcha{
    width:200px;
    display:block;
    margin-left:auto;
    margin-right:auto;
    margin-top:10px;
}
.erro {
    background:#f8d7da;
    color:#721c24;
    padding:10px;
    border-radius:5px;
    margin-bottom:15px;
    text-align:center;
    border:1px solid #f5c2c7;
}
/* ============================= */
/* ALERTAS */
/* ============================= */
#msg-alerta{
    position:fixed;
    top:20px;
    left:50%;
    transform:translateX(-50%);
    padding:20px 40px;
    border-radius:12px;
    box-shadow:0 6px 20px rgba(0,0,0,0.18);
    font-size:1.1em;
    font-weight:bold;
    color:#fff;
    z-index:9999;
    max-width:90%;
    text-align:center;
}
#msg-alerta.sucesso{background:#009739;}
#msg-alerta.erro{background:#dc3545;}
.alertaemitirnfse{
    max-width:50%;
    width:100%;
    padding:14px;
    border-radius:8px;
    margin:20px auto;
    font-family:"Segoe UI", Roboto, Arial, sans-serif;
    font-size:15px;
    border:1px solid transparent;
    transition:all 0.3s ease;
    box-shadow:0 4px 8px rgba(0,0,0,0.08);
}
.alertaemitirnfse.success{background:#d4edda;color:#0f5132;border-color:#badbcc;}
.alertaemitirnfse.danger{background:#f8d7da;color:#721c24;border-color:#f5c2c7;}
.alertaemitirnfse:hover{opacity:0.95;}
#msg-sucesso{
    position:fixed;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    background-color:#009739;
    color:white;
    padding:20px 35px;
    border-radius:8px;
    box-shadow:0 4px 8px rgba(0,0,0,0.2);
    font-weight:bold;
    z-index:9999;
    opacity:0;
    animation:fadeinout 0.5s ease forwards, fadeout 0.5s ease 4s forwards;
}
@keyframes fadeinout{
    from{opacity:0;}
    to{opacity:1;}
}
@keyframes fadeout{
    to{opacity:0;visibility:hidden;}
}
/* ============================= */
/* PAGINAÇÃO */
/* ============================= */
.paginacao{
    text-align:center;
    margin:20px 0;
}
.paginacao a{
    display:inline-block;
    padding:8px 12px;
    margin:3px;
    background:#ffffff;
    border:1px solid #dee2e6;
    border-radius:5px;
    text-decoration:none;
    color:#212529;
    font-weight:600;
}
.paginacao a:hover{
    background:#009739;
    color:white;
    border-color:#009739;
}
.paginacao .ativo{
    background:#009739;
    color:white;
    border-color:#009739;
}
/* ============================= */
/* TITULO NFS-e */
/* ============================= */
.emitirnfse-titulo-container{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:20px;
    width:100%;
    margin:20px auto;
    flex-wrap:nowrap;
    text-align:center;
}
.emitirnfse-titulo-container h1{margin:0;font-size:24px;color:#009739;}
.emitirnfse-numero-dps{font-size:18px;font-weight:600;color:#495057;}
/* BOTÕES ALTERAR NÚMERO */
.emitirnfse-btn-alterar{
    padding:6px 12px;
    border:none;
    background:#009739;
    color:#fff;
    border-radius:6px;
    cursor:pointer;
    font-size:14px;
}
.emitirnfse-btn-alterar:hover{background:#00732c;}
/* EDITAR NÚMERO */
.emitirnfse-editar-box{
    display:flex;
    align-items:center;
    gap:10px;
}
.emitirnfse-input-numero{
    width:120px;
    padding:8px;
    border:1px solid #ced4da;
    border-radius:6px;
    margin-top:10px;
}
.emitirnfse-btn-salvar{
    background:#009739;
    color:#fff;
    border:none;
    padding:8px 14px;
    border-radius:6px;
    cursor:pointer;
}
.emitirnfse-btn-salvar:hover{background:#00732c;}
/* ============================= */
/* MODAL */
/* ============================= */
.emitirnfse-modal{
    display:none;
    position:fixed;
    z-index:9999;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.5);
    justify-content:center;
    align-items:center;
}
.emitirnfse-modal-box{
    background:#fff;
    padding:25px;
    border-radius:10px;
    box-shadow:0 10px 30px rgba(0,0,0,0.2);
    text-align:center;
    min-width:260px;
    border:1px solid #dee2e6;
}
.emitirnfse-modal-botoes{
    margin-top:15px;
    display:flex;
    justify-content:center;
    gap:10px;
}
.emitirnfse-btn-cancelar{
    background:#dc3545;
    color:#fff;
    border:none;
    padding:8px 14px;
    border-radius:6px;
    cursor:pointer;
}
/* ============================= */
/* NFSE BUTTONS FILTROS */
/* ============================= */
.nfse_button_filtros{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:34px;
    padding:0 14px;
    border-radius:6px;
    font-size:12px;
    color:#fff;
    line-height:1;
    border:none;
    text-decoration:none;
    cursor:pointer;
    box-sizing:border-box;
    vertical-align:middle;
    transition:0.2s;
    font-weight:600;
}
/* BUSCAR */
.nfse_button_filtros.buscar{
    background:#009739;
    margin-top: auto;
}
.nfse_button_filtros.buscar:hover{
    background:#00732c;
}
/* LIMPAR */
.nfse_button_filtros.limpar{
    background:#009739;
    margin-top: auto;
}
.nfse_button_filtros.limpar:hover{
    background:#00732c;
}
/* FORMULARIO FILTRO */
.emitirnfse-filtro-form{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    justify-content:center;
}
.emitirnfse-input{
    padding:8px 10px;
    border:1px solid #ced4da;
    border-radius:6px;
    font-size:14px;
    min-width:220px;
}
.emitirnfse-select{
    padding:8px 10px;
    border:1px solid #ced4da;
    border-radius:6px;
    font-size:14px;
}
/* ============================= */
/* TABELA NFS-e */
/* ============================= */
.tablelistarnfse{
    width:80%;
    border-collapse:collapse;
    margin:20px auto;
    font-family:Arial, sans-serif;
    font-size:14px;
    text-align:left;
    table-layout:auto;
}
.tablelistarnfse th,
.tablelistarnfse td{
    padding:10px 12px;
    border-bottom:1px solid #dee2e6;
    vertical-align:middle;
}
.tablelistarnfse th{
    background:#009739;
    color:#fff;
    font-weight:600;
    text-align:left;
    white-space:nowrap;
}
.tablelistarnfse tr:nth-child(even){background:#f8f9fa;}
.tablelistarnfse tr:hover{background:#e8f5e8;}  /* Hover verde claro */
.status_emitida{background:#009739;color:#fff;padding:3px 8px;border-radius:4px;font-size:13px;font-weight:500;white-space:nowrap;}
.status_cancelada{background:#dc3545;color:#fff;padding:3px 8px;border-radius:4px;font-size:13px;font-weight:500;white-space:nowrap;}
.status_erro{background:#ffc107;color:#000;padding:3px 8px;border-radius:4px;font-size:13px;font-weight:500;white-space:nowrap;}
/* BOTOES TABELA */
.tablelistarnfse .btn{
    display:inline-block;
    padding:4px 10px;
    margin:1px 3px 3px 0;
    border-radius:5px;
    font-size:13px;
    text-decoration:none;
    cursor:pointer;
    color:#fff;
    transition:all .2s ease;
}
.tablelistarnfse .btn.pdf{background:#0d6efd;}
.tablelistarnfse .btn.pdf:hover{background:#0b5ed7;}
.tablelistarnfse .btn.xml{background:#6c757d;}
.tablelistarnfse .btn.xml:hover{background:#5c636a;}
.tablelistarnfse .btn.cancel{background:#dc3545;}
.tablelistarnfse .btn.cancel:hover{background:#bb2d3b;}
/* ============================= */
/* RESPONSIVO MOBILE */
/* ============================= */
@media screen and (max-width:768px){
.tablelistarnfse{
    display:block;
    width:calc(100% - 20px);
    margin:0 auto;
}
.tablelistarnfse thead{display:none;}
.tablelistarnfse tbody,
.tablelistarnfse tr,
.tablelistarnfse td{
    display:block;
    width:100%;
}
.tablelistarnfse tr{
    border:1px solid #dee2e6;
    border-radius:6px;
    margin-bottom:15px;
    padding:10px;
    background:#fff;
    box-sizing:border-box;
}
.tablelistarnfse td{
    padding:6px 0;
    border-bottom:1px solid #eee;
    font-size:13px;
    word-break:break-word;
    display:flex;
    justify-content:space-between;
}
.tablelistarnfse td:last-child{border-bottom:none;}
.tablelistarnfse td::before{
    content:attr(data-label);
    font-weight:600;
    flex:1;
    color:#495057;
    margin-right:10px;
}
.tablelistarnfse .btn{
    margin:4px 4px 0 0;
    padding:4px 8px;
    font-size:12px;
}
.emitirnfse-filtro-form{
    flex-direction:column;
    align-items:stretch;
}
.emitirnfse-input,
.emitirnfse-select{
    width:100%;
}
}