:root {
    --bg-body: #f8fafc;
    --brand-color: rgb(7, 65, 147);
    --accent-color: rgb(7, 65, 147);
    --card-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

body { 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    background: var(--bg-body); 
    color: #334155; 
    padding-bottom: 80px; 
}

.container { 
    width: 98%; 
    max-width: 1400px; 
    margin: 25px auto; 
    background: #ffffff; 
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    padding: 15px; 
    border: 1px solid #e2e8f0; 
}

.header-section { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid #e2e8f0; 
}

#filtro { 
    width: 400px; 
    padding: 10px 18px; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    font-size: 14px; 
    outline: none; 
    transition: border-color 0.2s; 
}

#filtro:focus { 
    border-color: var(--brand-color); 
    box-shadow: 0 0 0 3px rgba(7, 65, 147, 0.1); 
}

.norma-group { margin-bottom: 40px; }
.norma-title { 
    font-size: 20px; 
    color: var(--brand-color); 
    margin-bottom: 15px; 
    padding-left: 15px; 
    border-left: 5px solid var(--accent-color); 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

/* Estilos da Tabela com Grid e Alinhamentos */
.table-responsive { 
    width: 100%; 
    overflow-x: auto; 
    border-radius: 10px; 
    border: 1px solid #cbd5e1; 
    box-shadow: var(--card-shadow); 
}

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #ffffff; 
    font-size: 11px; /* Corrigido de 50px para manter proporção correta */
    table-layout: auto; /* Ajustado para acomodar bem as várias colunas */
}

.data-table th { 
    background: var(--brand-color); 
    color: #ffffff; 
    padding: 6px 4px; 
    font-weight: 600; 
    text-transform: uppercase; 
    font-size: 10px; 
    letter-spacing: 0.3px; 
    border: 1px solid #05316c; 
    text-align: center; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.data-table th:first-child { 
    text-align: left;
    padding-left: 8px;
}

.data-table th:last-child, 
.data-table td:last-child {
    white-space: nowrap;
    text-align: center;
}

.data-table td { 
    padding: 6px 4px; 
    color: #1e293b; 
    border: 1px solid #e2e8f0; 
    text-align: center; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    font-size: 11px;
}

.data-table td:first-child { 
    text-align: left; 
    padding-left: 8px;
}

.data-table tbody tr { background: #ffffff; transition: background 0.2s; }
.data-table tbody tr:nth-child(even) { background: #f8fafc; }
.data-table tbody tr:hover { background: #f1f5f9; }

/* Botão Adicionar ao desenho */
.data-table td button { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 4px; 
    padding: 4px 10px; 
    background: transparent; 
    color: var(--brand-color); 
    font-weight: 600; 
    text-decoration: none; 
    border-radius: 6px; 
    font-size: 11px; 
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}

.data-table td button:hover { 
    background: var(--brand-color); 
    border-color: var(--brand-color);
    color: #ffffff; 
}

/* RESPONSIVIDADE APENAS PARA DISPOSITIVOS MÓVEIS (Abaixo de 900px) */
@media (max-width: 900px) {
    body { background: #ffffff; }

    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 10px;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .header-section {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
        padding: 15px;
        background: #f8fafc;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
    }

    #filtro {
        width: 100%;
        padding: 12px 15px;
        font-size: 15px;
        background: #ffffff;
    }

    .norma-group { margin-bottom: 25px; }

    .norma-title {
        font-size: 16px;
        padding-left: 12px;
        border-left-width: 4px;
        margin-bottom: 12px;
    }

    .table-responsive {
        border: none;
        box-shadow: none;
        background: transparent;
        overflow-x: visible;
        border-radius: 0;
    }

    .data-table, .data-table thead, .data-table tbody, .data-table tr, .data-table th {
        display: block;
        width: 100%;
    }

    .data-table thead { display: none; }
    .data-table td { display: none; }

    .data-table td:first-child,
    .data-table td:nth-child(2),
    .data-table td:last-child {
        display: block;
        border: none;
        white-space: normal;
    }

    .data-table tbody tr {
        background: #ffffff;
        border: 1px solid #cbd5e1;
        border-radius: 14px;
        margin-bottom: 12px;
        padding: 14px 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .data-table tbody tr:nth-child(even) { background: #ffffff; }

    .data-table td:first-child {
        text-align: left;
        padding: 0;
        font-size: 19px;
        color: var(--brand-color);
        font-weight: 700;
        flex: 1 1 auto;
    }

    .data-table td:nth-child(2) {
        text-align: left;
        padding: 0;
        font-size: 13px;
        color: #64748b;
        flex: 0 1 auto;
        margin-left: 8px;
    }

    .data-table td:first-child::before,
    .data-table td:nth-child(2)::before {
        display: none;
    }

    .data-table td:last-child {
        display: flex;
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px dashed #e2e8f0;
        margin-top: 4px;
    }

    .data-table td button {
        width: 100%;
        padding: 9px;
        font-size: 13px;
        justify-content: center;
        background: var(--brand-color);
        color: #ffffff;
        border: none;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(7, 65, 147, 0.2);
    }

    .data-table td button:hover {
        background: #05316c;
        color: #ffffff;
    }

    /* Container do Painel */
.side-panel {
    position: fixed;
    top: 50%;
    right: -320px; /* Esconde o painel fora da tela */
    transform: translateY(-50%);
    width: 320px;
    background-color: #ffffff;
    box-shadow: -4px 0 15px rgba(0,0,0,0.15);
    border-radius: 8px 0 0 8px;
    transition: right 0.3s ease-in-out;
    z-index: 9999;
}

/* Estado Aberto */
.side-panel.open {
    right: 0;
}

/* Botão da Seta (Aba) */
.toggle-btn {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 50px;
    background-color: #0056b3;
    color: #ffffff;
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: -3px 0 8px rgba(0,0,0,0.15);
}

.toggle-btn i {
    transition: transform 0.3s ease;
}

/* Rotaciona a seta ao abrir */
.side-panel.open .toggle-btn i {
    transform: rotate(180deg);
}

/* Conteúdo do Formulário */
.panel-content {
    padding: 20px;
}

.panel-content h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.btn-salvar {
    width: 100%;
    padding: 10px;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-salvar:hover {
    background-color: #003d82;
}

}

