/* =========================================================================
   css/regrasRubricas.css - ESTILOS DO CATÁLOGO DE CRITÉRIOS & RUBRICAS
   Módulo Estanque: Isolamento com prefixo .rubricas-
   Tema: Dark System integrado à interface da plataforma
   ========================================================================= */

.rubricas-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    color: #e2e8f0;
    box-sizing: border-box;
}

/* Barra Superior e Cabeçalho */
.rubricas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e293b;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #334155;
}

.rubricas-titulo-bloco h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rubricas-titulo-bloco p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: #94a3b8;
}

.rubricas-acoes-header {
    display: flex;
    gap: 0.75rem;
}

/* Layout Split: Critérios à esquerda, Detalhe das Rubricas à direita */
.rubricas-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .rubricas-layout {
        grid-template-columns: 1fr;
    }
}

/* Painel Lateral: Lista de Critérios */
.rubricas-sidebar {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rubricas-sidebar-header {
    padding: 1rem 1.25rem;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cbd5e1;
}

.rubricas-lista-criterios {
    display: flex;
    flex-direction: column;
    max-height: 620px;
    overflow-y: auto;
}

.rubricas-criterio-card {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.rubricas-criterio-card:hover {
    background: #27354a;
}

.rubricas-criterio-card.ativo {
    background: #1e3a5f;
    border-left: 4px solid #38bdf8;
}

.rubricas-card-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rubricas-card-nome {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f5f9;
}

.rubricas-badge-natureza {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    background: #334155;
    color: #94a3b8;
}

.rubricas-badge-natureza.rubrica {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.rubricas-badge-natureza.meta {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rubricas-card-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.3;
}

/* Painel Principal: Grade dos Níveis da Rubrica */
.rubricas-painel-detalhe {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rubricas-detalhe-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    padding-bottom: 1rem;
}

.rubricas-detalhe-info h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #f8fafc;
}

.rubricas-detalhe-info span {
    font-size: 0.825rem;
    color: #94a3b8;
}

.rubricas-tabela-niveis {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

.rubricas-tabela-niveis th {
    text-align: left;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.rubricas-linha-nivel {
    background: #0f172a;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.rubricas-linha-nivel:hover {
    background: #162032;
}

.rubricas-linha-nivel td {
    padding: 0.75rem 1rem;
    vertical-align: top;
    border-top: 1px solid #334155;
    border-bottom: 1px solid #334155;
}

.rubricas-linha-nivel td:first-child {
    border-left: 1px solid #334155;
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.rubricas-linha-nivel td:last-child {
    border-right: 1px solid #334155;
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Siglas e Indicadores */
.rubricas-sigla-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    width: fit-content;
    height: 2.25rem;
    padding: 0 0.65rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.75rem;
    background: #1e293b;
    border: 1px solid #475569;
    white-space: nowrap;
    letter-spacing: 0.03em;
    box-sizing: border-box;
}

/* Cores das Siglas Pedagógicas (2 Letras) */
.rubricas-sigla-PL { background: rgba(16, 185, 129, 0.2); color: #34d399; border-color: #10b981; }
.rubricas-sigla-AD { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border-color: #0284c7; }
.rubricas-sigla-BS { background: rgba(234, 179, 8, 0.2);  color: #facc15; border-color: #eab308; }
.rubricas-sigla-AL { background: rgba(249, 115, 22, 0.2); color: #fb923c; border-color: #f97316; }
.rubricas-sigla-IN { background: rgba(249, 115, 22, 0.2); color: #fb923c; border-color: #f97316; }
.rubricas-sigla-CR { background: rgba(239, 68, 68, 0.2);  color: #f87171; border-color: #ef4444; }
.rubricas-sigla-IX { background: rgba(148, 163, 184, 0.2); color: #94a3b8; border-color: #64748b; }

/* Cores Semânticas para os Slugs de Prazo */
.rubricas-sigla-NO_PRAZO   { background: rgba(16, 185, 129, 0.2); color: #34d399; border-color: #10b981; }
.rubricas-sigla-PONTUAL    { background: rgba(16, 185, 129, 0.2); color: #34d399; border-color: #10b981; }
.rubricas-sigla-JUSTIFICADO{ background: rgba(56, 189, 248, 0.2); color: #38bdf8; border-color: #0284c7; }
.rubricas-sigla-ATESTADO   { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border-color: #0284c7; }
.rubricas-sigla-ABONADO    { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border-color: #0284c7; }
.rubricas-sigla-ATRASADO   { background: rgba(234, 179, 8, 0.2);  color: #facc15; border-color: #eab308; }
.rubricas-sigla-EXPIRADO   { background: rgba(239, 68, 68, 0.2);  color: #f87171; border-color: #ef4444; }

/* Inputs da Grade de Rubricas */
.rubricas-input-rotulo {
    width: 140px;
    background: #1e293b;
    border: 1px solid #475569;
    color: #f8fafc;
    padding: 0.45rem 0.65rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.rubricas-input-pct {
    width: 85px;
    background: #1e293b;
    border: 1px solid #475569;
    color: #38bdf8;
    padding: 0.45rem 0.65rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: right;
}

.rubricas-textarea-desc {
    width: 100%;
    min-height: 52px;
    background: #1e293b;
    border: 1px solid #475569;
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
}

.rubricas-input-rotulo:focus,
.rubricas-input-pct:focus,
.rubricas-textarea-desc:focus {
    outline: none;
    border-color: #38bdf8;
    background: #182234;
}

/* Rodapé de Ações */
.rubricas-rodape-acoes {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
}

.rubricas-feedback-msg {
    font-size: 0.875rem;
    color: #34d399;
    opacity: 0;
    transition: opacity 0.3s;
}

.rubricas-feedback-msg.visivel {
    opacity: 1;
}

/* Modais do Módulo */
.rubricas-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.rubricas-modal-overlay.open {
    display: flex;
}

.rubricas-modal-card {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.rubricas-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.rubricas-form-group label {
    font-size: 0.825rem;
    font-weight: 500;
    color: #94a3b8;
}

.rubricas-form-input, .rubricas-form-select {
    background: #0f172a;
    border: 1px solid #475569;
    color: #f8fafc;
    padding: 0.55rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}
/* Classes de Colunas e Alinhamento Estrutural */
.rubricas-col-sigla {
    min-width: 90px;
    width: auto;
    white-space: nowrap;
    text-align: center;
    padding-right: 0.75rem !important;
}

.rubricas-col-rotulo {
    width: 170px;
}

.rubricas-col-pct {
    width: 110px;
    white-space: nowrap;
}

.rubricas-col-desc {
    width: auto;
}

.rubricas-modal-header-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.rubricas-modal-titulo {
    margin: 0;
    color: #f8fafc;
    font-size: 1.1rem;
    font-weight: 600;
}

.rubricas-modal-acoes {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
}
/* Box de Visualização do Slug Travado */
.rubricas-modal-card .box-preview-codigo-turma {
    background: #0f172a;
    border: 1px dashed #334155;
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
}

.rubricas-modal-card .txt-preview-codigo-turma {
    color: #38bdf8;
    font-family: monospace;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}