/* ==========================================================================
   Cartão de seleção — usado em:
   - Seleção de Prefeitura / Câmara (Pages/Index.cshtml)
   - Seleção de consultas/menus da entidade (Pages/Usuario/Home.cshtml)
   - Painéis da Home da entidade (gráfico de despesas + calendário)
   ========================================================================== */

.selecao-entidade {
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(23, 30, 69, .06);
}

    .selecao-entidade > .card-body {
        padding: 28px 28px 12px;
    }

.selecao-boasvindas {
    margin: 0 0 4px;
    font-size: .9rem;
    color: #6b7390;
}

.selecao-titulo {
    margin: 0 0 22px;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--abase-navy, #171e45);
}

/* ---------- Cards de tipo (Prefeituras / Câmaras) ---------- */
.tipo-entidade {
    --tipo-cor: var(--abase-orange, #f2542d);
    --tipo-cor-texto: var(--abase-orange-escuro, #d8431f);
    --tipo-fundo: rgba(242, 84, 45, .10);
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #e6e9f2;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(23, 30, 69, .05);
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

    .tipo-entidade.tipo-camara {
        --tipo-cor: var(--abase-navy, #171e45);
        --tipo-cor-texto: var(--abase-navy, #171e45);
        --tipo-fundo: rgba(23, 30, 69, .08);
    }

    .tipo-entidade:hover,
    .tipo-entidade:focus-visible {
        transform: translateY(-3px);
        border-color: var(--tipo-cor);
        box-shadow: 0 10px 24px rgba(23, 30, 69, .12);
        color: inherit;
        text-decoration: none;
    }

    .tipo-entidade:focus-visible {
        outline: 2px solid var(--tipo-cor);
        outline-offset: 2px;
    }

    /* tipo selecionado (filtro aplicado na lista abaixo) */
    .tipo-entidade.ativo {
        border-color: var(--tipo-cor);
        background: var(--tipo-fundo);
        box-shadow: inset 0 0 0 1px var(--tipo-cor);
    }

.tipo-entidade-icone {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--tipo-cor);
    background: var(--tipo-fundo);
    transition: transform .2s ease;
}

.tipo-entidade:hover .tipo-entidade-icone {
    transform: scale(1.06);
}

.tipo-entidade-texto {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tipo-entidade-nome {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--abase-navy, #171e45);
}

.tipo-entidade-desc {
    margin-top: 2px;
    font-size: .82rem;
    color: #6b7390;
}

    .tipo-entidade-desc i {
        vertical-align: middle;
        transition: transform .2s ease;
    }

.tipo-entidade:hover .tipo-entidade-desc i {
    transform: translateX(3px);
}

.tipo-entidade-total {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}

    .tipo-entidade-total > span {
        font-size: 2.1rem;
        font-weight: 600;
        color: var(--tipo-cor-texto);
    }

    .tipo-entidade-total small {
        margin-top: 4px;
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: #8a91ab;
    }

/* ---------- Busca ---------- */
.selecao-busca-label {
    display: block;
    margin: 6px 0 8px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--abase-navy, #171e45);
}

.selecao-busca {
    position: relative;
    margin-bottom: 18px;
}

    .selecao-busca > i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        color: #8a91ab;
        pointer-events: none;
    }

    .selecao-busca .form-control {
        height: 46px;
        padding-left: 44px;
        border: 1px solid #e0e4ee;
        border-radius: 10px;
        background: #f7f8fb;
        transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    }

        .selecao-busca .form-control:focus {
            border-color: var(--abase-orange, #f2542d);
            background: #fff;
            box-shadow: 0 0 0 3px rgba(242, 84, 45, .15);
        }

/* ---------- Responsivo ---------- */
@media (max-width: 575px) {
    .selecao-entidade > .card-body {
        padding: 20px 16px 8px;
    }

    .selecao-titulo {
        font-size: 1.2rem;
    }

    .tipo-entidade {
        gap: 14px;
        padding: 16px;
    }

    .tipo-entidade-icone {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        font-size: 24px;
    }

    .tipo-entidade-nome {
        font-size: 1rem;
    }

    .tipo-entidade-total > span {
        font-size: 1.6rem;
    }
}

/* ---------- Modo escuro ---------- */
html.theme-dark .selecao-titulo,
html.theme-dark .tipo-entidade-nome,
html.theme-dark .selecao-busca-label {
    color: var(--esc-text, #e3e6f0);
}

html.theme-dark .selecao-boasvindas,
html.theme-dark .tipo-entidade-desc {
    color: var(--esc-muted, #9aa2c0);
}

html.theme-dark .tipo-entidade {
    background: var(--esc-surface-2, #1e2750);
    border-color: var(--esc-border, #2b3564);
    box-shadow: none;
}

    html.theme-dark .tipo-entidade:hover {
        box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
    }

    /* navy some no fundo escuro: câmaras usam um navy claro */
    html.theme-dark .tipo-entidade.tipo-camara {
        --tipo-cor: #9aa6e8;
        --tipo-cor-texto: #b4bdf0;
        --tipo-fundo: rgba(154, 166, 232, .14);
    }

    html.theme-dark .tipo-entidade.tipo-prefeitura {
        --tipo-cor-texto: #ff8a5c;
    }

html.theme-dark .selecao-busca .form-control {
    background: var(--esc-surface-2, #1e2750);
    border-color: var(--esc-border, #2b3564);
}

    html.theme-dark .selecao-busca .form-control:focus {
        background: var(--esc-surface-2, #1e2750);
    }

/* ==========================================================================
   Painéis da Home (Despesas mensal + Calendário de Licitações)
   Mesma "pele" do cartão de seleção; as colunas são d-flex, então os dois
   cards esticam até a altura do mais alto (o calendário) e o gráfico ocupa
   o espaço que sobrar.
   ========================================================================== */
.painel-home {
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(23, 30, 69, .06);
    margin-bottom: 0;
}

    .painel-home > .card-body {
        display: flex;
        flex-direction: column;
        padding: 24px 26px;
    }

.painel-home-cabecalho {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.painel-home-icone {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--abase-orange, #f2542d);
    background: rgba(242, 84, 45, .10);
}

.painel-home-titulo {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--abase-navy, #171e45);
}

.painel-home-subtitulo {
    font-size: .8rem;
    color: #6b7390;
}

.painel-home-grafico {
    position: relative;
    flex: 1 1 auto;
    min-height: 340px;
}

    .painel-home-grafico canvas {
        position: absolute;
        inset: 0;
    }

.painel-home-label {
    display: block;
    margin-bottom: 6px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--abase-navy, #171e45);
}

.painel-home-filtros {
    margin-bottom: 8px;
}

    .painel-home-filtros .form-control,
    .painel-home-filtros .input-group > .btn,
    .painel-home-filtros .bootstrap-select > .dropdown-toggle {
        height: 40px;
        border-color: #e0e4ee;
    }

    .painel-home-filtros .input-group > .form-control {
        border-radius: 10px 0 0 10px;
    }

    .painel-home-filtros .input-group > .btn {
        border-radius: 0 10px 10px 0;
    }

    .painel-home-filtros .bootstrap-select > .dropdown-toggle {
        border-radius: 10px;
    }

/* ---------- FullCalendar ---------- */
.painel-home .fc-toolbar h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--abase-navy, #171e45);
}

.painel-home .fc-button-primary {
    background-color: var(--abase-navy, #171e45);
    border-color: var(--abase-navy, #171e45);
    color: #fff;
    border-radius: 8px;
}

    .painel-home .fc-button-primary:hover,
    .painel-home .fc-button-primary:not(:disabled):active,
    .painel-home .fc-button-primary:not(:disabled).fc-button-active {
        background-color: var(--abase-orange, #f2542d);
        border-color: var(--abase-orange, #f2542d);
        color: #fff;
        opacity: 1;
    }

    .painel-home .fc-button-primary:disabled {
        background-color: #c5c9d8;
        border-color: #c5c9d8;
        color: #fff;
    }

.painel-home .fc-button-group > .fc-button:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.painel-home .fc-button-group > .fc-button:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.painel-home .fc th.fc-widget-header {
    background: #f4f5f9;
    color: #6b7390;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
}

.painel-home .fc-unthemed td,
.painel-home .fc-unthemed th {
    border-color: #e6e9f2;
}

/* dia de hoje: o vendor usa !important (cinza + borda vermelha) */
.painel-home .fc-unthemed .fc-today {
    background: rgba(242, 84, 45, .07) !important;
    border-color: #e6e9f2;
}

    .painel-home .fc-unthemed .fc-today .fc-day-number {
        color: var(--abase-orange-escuro, #d8431f);
        font-weight: 600;
    }

.painel-home .fc-day-grid-event {
    border-radius: 4px;
    padding: 1px 4px;
    cursor: pointer; /* o clique abre o modal da licitação */
}

@media (max-width: 575px) {
    .painel-home > .card-body {
        padding: 18px 16px;
    }

    .painel-home-grafico {
        min-height: 260px;
    }
}

/* ---------- Painéis no modo escuro ---------- */
html.theme-dark .painel-home-titulo,
html.theme-dark .painel-home-label,
html.theme-dark .painel-home .fc-toolbar h2 {
    color: var(--esc-text, #e3e6f0);
}

html.theme-dark .painel-home-subtitulo {
    color: var(--esc-muted, #9aa2c0);
}

html.theme-dark .painel-home .fc-day {
    background: transparent;
}

html.theme-dark .painel-home .fc th.fc-widget-header {
    background: var(--esc-surface-2, #1e2750);
    color: var(--esc-muted, #9aa2c0);
}

html.theme-dark .painel-home .fc-unthemed td,
html.theme-dark .painel-home .fc-unthemed th,
html.theme-dark .painel-home-filtros .form-control,
html.theme-dark .painel-home-filtros .input-group > .btn,
html.theme-dark .painel-home-filtros .bootstrap-select > .dropdown-toggle {
    border-color: var(--esc-border, #2b3564);
}

html.theme-dark .painel-home .fc-button-primary {
    background-color: var(--esc-surface-2, #1e2750);
    border-color: var(--esc-border, #2b3564);
}

html.theme-dark .painel-home .fc-button-primary:disabled {
    background-color: #2b3564;
    border-color: #2b3564;
    color: var(--esc-muted, #9aa2c0);
}
