/*
 * Painel "Variáveis disponíveis" do formulário de Modelos de Contrato
 * (resources/views/filament/contrato/variaveis-disponiveis.blade.php).
 * Este painel é uma view solta dentro do Schema do Resource, não um
 * componente nativo do Filament — por isso precisa da própria folha de
 * estilo escopada, nos moldes de frete-endereco-chip/relatorios-tabs
 * (var(--app-*) do tema, não classes utilitárias do Tailwind: este app
 * não roda um build Tailwind sobre os Blades próprios — só o pacote
 * estático do Filament).
 */

.cm-variaveis {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cm-variaveis__titulo {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--app-text);
}

.cm-variaveis__descricao {
    font-size: 0.75rem;
    color: var(--app-muted);
}

.cm-variaveis__accordion {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--app-divider);
}

.cm-variaveis__acc-item {
    border-bottom: 1px solid var(--app-divider);
}

.cm-variaveis__acc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.625rem 0.125rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--app-text);
    text-align: left;
}

.cm-variaveis__acc-chevron {
    width: 1rem;
    height: 1rem;
    color: var(--app-muted);
    transition: transform 150ms ease;
    flex-shrink: 0;
}

.cm-variaveis__acc-chevron--aberto {
    transform: rotate(180deg);
}

.cm-variaveis__acc-panel {
    padding: 0 0.125rem 0.75rem;
}

.cm-variaveis__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.cm-variaveis__chip {
    padding: 0.3125rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--app-border);
    background-color: var(--app-subtle);
    color: var(--app-text);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.cm-variaveis__chip:hover {
    border-color: var(--app-accent);
    background-color: var(--app-accent-soft);
}

/* Mesmo breakpoint lg do grid (1 + 3 colunas). O wrapper intermediário
 * .fi-sc-component ocupa a altura da linha e limita o sticky ao editor.
 * Topbar Filament: min-h-16 (4rem); respiro superior/inferior: 1rem.
 */
@media (min-width: 64rem) {
    .cm-variaveis-panel {
        position: sticky;
        top: 5rem;
        align-self: start;
        max-height: calc(100vh - 6rem);
        max-height: calc(100dvh - 6rem);
        overflow-y: auto;
        scrollbar-width: thin;
    }
}
