/* ==========================================
   ARQUIVO DE ESTILO GLOBAL - PRÉ-CONSELHO
   ========================================== */

*{box-sizing:border-box}

body{
    font-family:"Segoe UI", Arial, sans-serif;
    margin:0;
    padding:30px;
    color:#1f2937;
    background:
            radial-gradient(circle at top left, rgba(0,84,159,.12), transparent 30%),
            linear-gradient(135deg,#f5f9fd,#e7eff7);
    min-height:100vh;
}

:root{
    --azul:#003b71;
    --azul2:#0b5ea8;
    --azul-claro:#eaf4ff;
    --texto:#1e293b;
    --borda:#d9e3ee;
    --sucesso:#198754;
}

html{scroll-behavior:smooth}

.container{
    max-width:900px;
    margin:auto;
    background:#fff;
    border-radius:16px;
    box-shadow:0 10px 30px rgba(0,0,0,0.12);
    overflow:hidden;
    position: relative;
}

.header{
    background:#003b71;
    color:white;
    padding:28px;
    text-align:center;
}

.header h1{
    margin:0;
    font-size:28px;
}

.header p{
    margin-top:8px;
    font-size:15px;
}

.progress-wrap{
    position:sticky;
    top:0;
    z-index:20;
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(10px);
    padding:10px 30px;
    border-bottom:1px solid var(--borda);
}

.progress-track{
    height:7px;
    border-radius:999px;
    background:#e7edf4;
    overflow:hidden;
}

.progress-bar-custom{
    height:100%;
    width:0;
    border-radius:999px;
    background:linear-gradient(90deg,var(--azul),#2b83d5);
    transition:width .25s ease;
}

form{
    padding:30px;
}

.section-title{
    margin-top:25px;
    margin-bottom:15px;
    font-size:18px;
    color:#003b71;
    padding:12px 14px;
    border-radius:12px;
    background:linear-gradient(90deg,var(--azul-claro),transparent);
    font-weight:700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap:9px;
}

.section-title-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.section-title-left::before{
    content:"";
    width:8px;
    height:28px;
    background:var(--azul);
    border-radius:999px;
}

.grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
}

label{
    display:block;
    font-weight:600;
    margin-bottom:6px;
}

.label-com-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-adicionar-item {
    background-color: #003b71;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.btn-adicionar-item:hover {
    background-color: #00549f;
    transform: scale(1.1);
}

.btn-recarregar-cache {
    background: transparent;
    border: 1px solid #003b71;
    color: #003b71;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s, color 0.2s;
}

.btn-recarregar-cache:hover {
    background-color: #003b71;
    color: white;
}

input, select, textarea{
    width:100%;
    padding:12px;
    border:1px solid #cbd5e1;
    border-radius:10px;
    font-size:15px;
    background:#f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input.campo-erro, select.campo-erro, textarea.campo-erro {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 4px rgba(220,53,69,0.1) !important;
    background-color: #fff8f8;
}

textarea{
    resize:vertical;
}

.checkbox-group{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-top:10px;
}

.checkbox-item{
    background:#f8fafc;
    border:1px solid #dbe3ec;
    padding:10px;
    border-radius:10px;
    display:flex;
    align-items:center;
    gap:8px;
    cursor:pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.checkbox-item:hover{
    transform:translateY(-1px);
    border-color:#9fc1df;
    box-shadow:0 4px 12px rgba(0,59,113,.07);
}

.checkbox-item:has(input:checked){
    background:#eaf4ff;
    border-color:#5c9ed7;
    box-shadow:0 0 0 2px rgba(0,84,159,.06);
}

.checkbox-item input{
    width:18px;
    height:18px;
    accent-color:var(--azul);
}

.section-counter{
    margin:8px 0 2px;
    color:#64748b;
    font-size:13px;
    font-weight:600;
}

.botoes-envio-container {
    display: flex;
    gap: 15px;
    margin-top: 28px;
}

button[type="submit"], .btn-modo-lote{
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

button[type="submit"]{
    background:#003b71;
    color:white;
    box-shadow:0 8px 20px rgba(0,59,113,.18);
    transition: background 0.2s;
}

button[type="submit"]:hover{
    background:#00549f;
}

.btn-modo-lote{
    background:#e2e8f0;
    color:#003b71;
    border: 2px solid #cbd5e1;
    transition: background 0.2s, color 0.2s;
}

.btn-modo-lote.ativo {
    background: #198754;
    color: white;
    border-color: #146c43;
}

#mensagem{
    text-align:center;
    margin-top:18px;
    font-weight:bold;
    min-height:24px;
}

/* Overlay de Carregamento */
#overlayCarregamento {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 99;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 15px;
    backdrop-filter: blur(2px);
}

.spinner-envio {
    width: 50px;
    height: 50px;
    border: 5px solid #e2e8f0;
    border-top: 5px solid #003b71;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.toast-sucesso{
    position:fixed;
    right:22px;
    bottom:22px;
    z-index:999;
    background:#17324d;
    color:#fff;
    padding:14px 18px;
    border-radius:12px;
    box-shadow:0 12px 30px rgba(0,0,0,.22);
    opacity:0;
    transform:translateY(14px);
    pointer-events:none;
    transition:.25s ease;
}

.toast-sucesso.show{
    opacity:1;
    transform:translateY(0);
}

.fade-in{
    animation:fadeIn .45s ease both;
}

@keyframes fadeIn{
    from{opacity:0;transform:translateY(8px)}
    to{opacity:1;transform:translateY(0)}
}

/* ==========================================
   ESTILOS ADICIONAIS PARA TABELAS E GESTÃO
   ========================================== */
.form-cadastro-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.tabela-container {
    width: 100%;
    max-height: 65vh;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.tabela-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabela-container th,
.tabela-container td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.tabela-container th {
    background-color: #f1f5f9;
    color: #003b71;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

.tabela-container tr:hover td {
    background-color: #f8fafc;
}

.btn-acao {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-acao:hover {
    background: #b02a37;
}

.topo-pagina {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.footer{
    text-align:center;
    font-size:13px;
    color:#6b7280;
    padding:18px;
    background:#f8fafc;
}

@media(max-width:700px){
    form{padding:22px 18px}
    .progress-wrap{padding:9px 18px}
    .header{padding:28px 20px}
    .checkbox-item{min-height:auto}
    .botoes-envio-container { flex-direction: column; }
}