/* =============================================================================================
   Códigos de justificação (VB6 Justif.frm). The page reuses the Empregados layout (.empregados: list | card, fixed
   footer); these are only its own pieces: the scope note, the colour sample, the card's blocks, the palette and the
   read-only table view.
   ============================================================================================= */
.justificacoes .emp-cabecalho .espaco {
    flex: 1;
}

.jus-ambito {
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--cr-blue-100);
    color: var(--cr-blue-600);
    font-size: .82rem;
    font-weight: 600;
}

/* The list: each code in its VB6 colour; codes without anomalies struck through (as the VB6 grid). */
.jus-lista-opcao {
    grid-template-columns: minmax(3.6rem, auto) minmax(0, 1fr);
}

.jus-lista-codigo {
    justify-self: start;
    min-width: 3.4rem;
    padding: .05rem .35rem;
    border-radius: 5px;
    text-align: center !important;
}

.jus-lista-opcao.riscado .emp-lista-nome,
.jus-tabela tr.riscado td {
    text-decoration: line-through;
}

.jus-novo {
    align-self: stretch;
}

/* The card: identity on top, the blocks (only they scroll), the fixed footer. */
.jus-ficha {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.jus-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.jus-topo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.jus-amostra {
    display: inline-grid;
    place-items: center;
    min-width: 5.4rem;
    height: 3.2rem;
    padding: 0 .8rem;
    border: 1px solid var(--cr-line-strong);
    border-radius: var(--cr-radius-sm);
    background: #fff;
    color: var(--cr-strong);
    font-size: 1.3rem;
    font-weight: 700;
}

.jus-titulo-nome {
    font-family: var(--cr-font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cr-strong);
}

.jus-titulo-tipo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .6rem;
    margin-top: .2rem;
}

.jus-alterado {
    color: var(--cr-text-2);
    font-size: .8rem;
}

.jus-corpo {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
    align-content: start;
}

.jus-maiusculas {
    text-transform: uppercase;
}

.jus-ajuda {
    margin: 0;
}

.jus-anomalia .mono {
    min-width: 2.6rem;
    font-weight: 600;
}

/* The special options in two columns when they fit (half the height). */
.jus-especiais {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .3rem .6rem;
}

.jus-prolongada {
    margin-top: .3rem;
    padding-top: .4rem;
    border-top: 1px solid var(--cr-line);
}

/* The VB6 palette (26 colours) plus "no colour" and, when it is outside the palette, the current colour. */
/* The palette sits at the right of the card's top band (two rows of small squares), so the blocks below fit. */
.jus-cores {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    min-width: 0;
}

    .jus-cores > legend {
        float: none;
        width: auto;
        margin-bottom: .25rem;
        font-size: .8rem;
    }

.jus-bloco-especial {
    grid-column: span 2;
}

.jus-paleta {
    display: grid;
    grid-template-columns: repeat(14, 1.5rem);
    gap: .3rem;
}

.jus-cor {
    position: relative;
    cursor: pointer;
}

    .jus-cor input {
        position: absolute;
        opacity: 0;
    }

    .jus-cor span {
        display: grid;
        place-items: center;
        width: 1.5rem;
        height: 1.5rem;
        border: 1px solid #9fb0c9;
        border-radius: 6px;
        background: #fff;
        color: var(--cr-text-2);
        font-size: .8rem;
    }

    .jus-cor input:checked + span {
        outline: 3px solid var(--cr-blue-600);
        outline-offset: 2px;
    }

    .jus-cor input:focus-visible + span {
        box-shadow: var(--cr-glow);
    }

.jus-so-leitura {
    margin: .6rem 0 0;
}

/* Table view: every code in its colours. */
.jus-tabela-painel {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 0;
}

.jus-tabela-barra {
    display: flex;
    align-items: center;
    gap: .5rem;
}

    .jus-tabela-barra .espaco {
        flex: 1;
    }

.jus-tabela tbody tr {
    cursor: pointer;
}

.jus-tabela td a {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.jus-nota {
    margin: 0;
}

@media (min-width: 1101px) {
    .justificacoes > .jus-tabela-painel {
        flex: 1 1 0;
    }

        .justificacoes > .jus-tabela-painel > .tabela-rolagem {
            flex: 1 1 0;
            min-height: 0;
            overflow: auto;
        }
}

/* Three columns while the card is beside the list; one when everything stacks. */
@media (max-width: 1100px) {
    .jus-corpo {
        grid-template-columns: minmax(0, 1fr);
    }

    .jus-bloco-especial {
        grid-column: auto;
    }

    .jus-topo {
        flex-wrap: wrap;
    }
}

@media print {
    .barra-topo, .barra-estado, .jus-vistas, .jus-tabela-barra button {
        display: none !important;
    }

    .jus-tabela-painel > .tabela-rolagem {
        overflow: visible !important;
    }
}

/* Row under the mouse in the "Tabela" view: a blue frame over the code's own colours. */
.jus-tabela tbody tr:hover td {
    box-shadow: inset 0 2px 0 var(--cr-blue-600), inset 0 -2px 0 var(--cr-blue-600);
    filter: brightness(.94);
    cursor: pointer;
}
