.promocoes {
    max-width: 1180px;
    margin: auto;
    padding: 36px;
    font-family: Inter, Arial, sans-serif;
    color: #183b59;
}

.promo-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.promo-kicker,
.promo-modal-header span {
    color: #d79f00;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.promo-topo h1 {
    margin: 2px 0;
    font-size: 32px;
}

.promo-topo p,
.familias-titulo p,
.tratamentos-titulo p {
    margin: 0;
    color: #70869a;
}

.promo-novo,
.promo-salvar {
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #173f63, #267caf);
    color: #fff;
    padding: 13px 18px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 8px 20px #173f6330;
}

.promo-novo i {
    margin-right: 8px;
}

/* RESUMO */

.promo-resumo {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.promo-resumo div {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2eaf1;
    border-radius: 10px;
    padding: 10px 15px;
}

.promo-resumo strong {
    font-size: 20px;
}

.promo-resumo span {
    color: #789;
}

/* GRID PROMOÇÕES */

.promo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.promo-card {
    background: #fff;
    border: 1px solid #e1eaf2;
    border-radius: 16px;
    padding: 19px;
    box-shadow: 0 8px 28px #173f6312;
    transition: .2s;
}

.promo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px #173f6320;
}

.promo-card.inativa {
    opacity: .67;
}

.promo-card-top,
.promo-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.promo-status {
    background: #edf1f4;
    color: #607386;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
}

.promo-status.ativo {
    background: #dcfce7;
    color: #14783b;
}

.promo-id {
    color: #98a8b6;
    font-size: 12px;
}

.promo-card h3 {
    min-height: 48px;
    margin: 16px 0 12px;
}

.promo-condicao {
    display: flex;
    align-items: center;
    gap: 11px;
    background: #f5f9fc;
    border-radius: 11px;
    padding: 12px;
}

.promo-condicao > i {
    color: #d7a300;
    font-size: 21px;
}

.promo-condicao small,
.promo-condicao strong {
    display: block;
}

.promo-condicao small {
    color: #7d91a3;
}

.promo-card footer {
    margin-top: 17px;
    color: #70869a;
}

.promo-editar {
    border: 0;
    background: #e8f1f8;
    color: #174f78;
    border-radius: 8px;
    padding: 8px 11px;
    cursor: pointer;
    font-weight: 700;
}

.promo-vazio {
    grid-column: 1 / -1;
    text-align: center;
    background: #fff;
    border: 1px dashed #cbd9e4;
    border-radius: 16px;
    padding: 55px;
    color: #70869a;
}

.promo-vazio i {
    font-size: 38px;
    color: #d7a300;
}

/* MODAL */

.promo-modal[hidden] {
    display: none !important;
}

.promo-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #092943c7;
    backdrop-filter: blur(5px);
}

.promo-modal-box {
    width: min(840px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 28px 80px #0007;
}

.promo-modal-header {
    display: flex;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid #e7eef4;
}

.promo-modal-header h2 {
    margin: 3px 0 0;
}

.promo-fechar {
    border: 0;
    background: #edf3f7;
    color: #456;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 25px;
    cursor: pointer;
}

/* FORMULÁRIO */

.promo-form-modal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px 28px;
}

.promo-form-modal label {
    font-size: 13px;
    font-weight: 750;
}

.promo-form-modal input,
.promo-form-modal textarea,
#buscar-familia,
#buscar-tratamento {
    box-sizing: border-box;
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #cbd9e4;
    border-radius: 9px;
    color: #173f63;
    background: #fff;
    outline: none;
}

.promo-form-modal input:focus,
.promo-form-modal textarea:focus,
#buscar-familia:focus,
#buscar-tratamento:focus {
    border-color: #267caf;
    box-shadow: 0 0 0 3px #267caf18;
}

.promo-form-modal textarea {
    min-height: 118px;
    resize: vertical;
    font: inherit;
    font-weight: 400;
    line-height: 1.45;
}

/* Datas */

#edit-data-inicio,
#edit-data-fim {
    min-height: 43px;
}

.campo-largo,
.promo-tipo {
    grid-column: 1 / -1;
}

.promo-tipo {
    display: flex;
    gap: 20px;
    background: #f5f8fb;
    padding: 12px;
    border-radius: 9px;
}

.promo-tipo input,
.promo-switch input {
    width: auto;
}

.promo-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-salvar {
    align-self: end;
}

/* ÁREA DE VÍNCULOS */

.promo-familias-modal {
    padding: 22px 28px 28px;
    border-top: 1px solid #e7eef4;
}

.promo-regras-par {
    margin: 0 28px;
    padding: 20px 0;
    border-top: 1px solid #e7eef4;
}

.promo-regras-par-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.promo-regras-par h3 { margin: 0; color: #173f63; }
.promo-regras-par p { margin: 5px 0 0; color: #60798d; font-size: 13px; }

.promo-regras-par-campos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 12px;
    background: #f5f8fb;
}

.promo-regras-par-campos > label:not(.promo-switch) {
    font-size: 13px;
    font-weight: 750;
}

.promo-regras-par-campos input[type="number"] {
    box-sizing: border-box;
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #cbd9e4;
    border-radius: 9px;
}

.promo-regras-par-campos .promo-salvar { grid-column: 1 / -1; justify-self: start; }

.promo-config-par { margin-top: 20px; padding-top: 18px; border-top: 1px solid #dce6ee; }
.promo-config-par h4 { margin: 0 0 12px; color: #173f63; }
.promo-config-par-ajuda { margin: -5px 0 12px; color: #60798d; font-size: 12px; }
.promo-config-par-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.promo-config-par-form input, .promo-config-par-form select { box-sizing: border-box; width: 100%; padding: 10px; border: 1px solid #cbd9e4; border-radius: 8px; }
.promo-config-par-lista { display: grid; gap: 7px; margin-top: 13px; }
.promo-config-par-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border-radius: 8px; color: #284b67; background: #fff; font-size: 13px; }
.promo-config-par-linha button { border: 0; border-radius: 6px; padding: 6px 8px; color: #9a2732; background: #feecef; cursor: pointer; }

/* ABAS FAMÍLIA / TRATAMENTO */

.vinculo-tipo {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
    padding: 5px;
    border-radius: 11px;
    background: #f1f6f9;
    border: 1px solid #dce6ee;
}

.vinculo-tipo button {
    flex: 1;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: transparent;
    color: #648096;
    font-weight: 750;
    cursor: pointer;
    transition: .2s;
}

.vinculo-tipo button:hover {
    background: #fff;
    color: #173f63;
}

.vinculo-tipo button.ativo {
    background: #fff;
    color: #13547a;
    box-shadow: 0 2px 8px #173f6320;
}

.vinculo-tipo button i {
    margin-right: 6px;
}

/* TÍTULOS */

.familias-titulo,
.tratamentos-titulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.familias-titulo h3,
.tratamentos-titulo h3 {
    margin: 0;
}

.familias-titulo > span,
.tratamentos-titulo > span {
    background: #fff2bf;
    color: #8b6900;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.regra-valor-ajuda {
    max-width: 520px;
    margin: 6px 0 0;
    color: #60798d;
    font-size: 12px;
    line-height: 1.45;
}

/* BUSCA */

.familia-busca,
.tratamento-busca {
    position: relative;
}

.familia-busca i,
.tratamento-busca i {
    position: absolute;
    left: 13px;
    top: 20px;
    color: #789;
}

.familia-busca input,
.tratamento-busca input {
    padding-left: 36px !important;
}

/* RESULTADOS */

.familias-resultado,
.tratamentos-resultado {
    max-height: 180px;
    overflow: auto;
    margin-top: 5px;
    border-radius: 9px;
    box-shadow: 0 8px 20px #0002;
}

.familia-opcao,
.familia-item,
.tratamento-opcao,
.tratamento-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    padding: 10px;
    border: 0;
    border-bottom: 1px solid #edf2f6;
    background: #fff;
    text-align: left;
    color: #173f63;
}

.familia-opcao,
.tratamento-opcao {
    cursor: pointer;
    transition: background .15s;
}

.familia-opcao:hover,
.tratamento-opcao:hover {
    background: #eef6fb;
}

.familia-opcao span,
.familia-item span,
.tratamento-opcao span,
.tratamento-item span {
    flex: 1;
    color: #173f63;
}

.familia-opcao b,
.tratamento-opcao b {
    color: #1f719f;
}

.familia-opcao small,
.tratamento-opcao small {
    display: block;
    margin-top: 2px;
    color: #648096;
    font-weight: 500;
}

.familia-opcao i,
.tratamento-opcao i {
    color: #198754;
}

/* ITEM SELECIONADO */

.familia-opcao.selecionada,
.tratamento-opcao.selecionada {
    background: #e5f6eb;
    color: #18733c;
}

.familia-opcao.confirmada,
.tratamento-opcao.confirmada {
    background: #d1f4dd;
    color: #106c35;
}

.familia-opcao.selecionada span,
.familia-opcao.confirmada span,
.tratamento-opcao.selecionada span,
.tratamento-opcao.confirmada span {
    color: #126b37 !important;
}

.familia-opcao.selecionada i,
.familia-opcao.confirmada i,
.tratamento-opcao.selecionada i,
.tratamento-opcao.confirmada i {
    color: #126b37 !important;
}

/* VINCULADOS */

.familias-vinculadas,
.tratamentos-vinculados {
    margin-top: 14px;
}

.familia-item,
.tratamento-item {
    margin-bottom: 7px;
    border: 1px solid #e1eaf2;
    border-radius: 9px;
}

.familia-item button,
.tratamento-item button {
    margin-left: auto;
    border: 0;
    border-radius: 7px;
    background: #fee2e2;
    color: #b42318;
    padding: 7px 10px;
    cursor: pointer;
}

.familia-item button:hover,
.tratamento-item button:hover {
    background: #fecaca;
}

.familia-item.familia-item-regra {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(100px, 140px)) auto auto;
    align-items: center;
    gap: 9px;
}

.familia-item-regra > div {
    min-width: 0;
}

.familia-item-regra input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 8px;
    border: 1px solid #cbd9e4;
    border-radius: 7px;
    color: #173f63;
}

.familia-item-regra .salvar-regra-valor {
    margin-left: 0;
    background: #e3f3fb;
    color: #13547a;
}

.familia-item-regra .salvar-regra-valor:hover {
    background: #cceaf7;
}

@media (max-width: 840px) {
    .familia-item.familia-item-regra {
        grid-template-columns: 1fr 1fr;
    }

    .familia-item-regra > div {
        grid-column: 1 / -1;
    }
}

/* ESTADO VAZIO */

.familia-vazia,
.tratamento-vazio {
    text-align: center;
    color: #8a9aa8;
    padding: 14px;
}

/* ÁREA TRATAMENTO */

#area-tratamentos[hidden],
#area-familias-vinculo[hidden] {
    display: none !important;
}

.no-scroll {
    overflow: hidden;
}

/* FILTROS */

.promo-filtros {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.promo-pesquisa {
    position: relative;
    flex: 1;
    max-width: 470px;
}

.promo-pesquisa i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8295a6;
}

.promo-pesquisa input {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid #d4e0e9;
    border-radius: 11px;
    background: #fff;
    color: #183b59;
    outline: none;
    box-shadow: 0 3px 12px #173f630a;
}

.promo-pesquisa input:focus {
    border-color: #267caf;
    box-shadow: 0 0 0 3px #267caf18;
}

.promo-status-filtro {
    display: flex;
    padding: 4px;
    border: 1px solid #dce6ee;
    border-radius: 11px;
    background: #eef4f8;
}

.promo-status-filtro button {
    border: 0;
    border-radius: 8px;
    padding: 8px 15px;
    background: transparent;
    color: #62798d;
    font-weight: 750;
    cursor: pointer;
}

.promo-status-filtro button.ativo {
    background: #fff;
    color: #173f63;
    box-shadow: 0 2px 8px #173f6320;
}

/* RESPONSIVO */

@media (max-width: 900px) {
    .promo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .promocoes {
        padding: 20px 14px;
    }

    .promo-topo {
        align-items: flex-start;
        flex-direction: column;
    }

    .promo-novo {
        width: 100%;
    }

    .promo-grid {
        grid-template-columns: 1fr;
    }

    .promo-form-modal {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .promo-form-modal > * {
        grid-column: 1;
    }

    .promo-modal {
        padding: 8px;
    }

    .promo-modal-box {
        max-height: 96vh;
    }

    .promo-familias-modal {
        padding: 20px;
    }

    .promo-novo span {
        display: inline;
    }

    .promo-filtros {
        align-items: stretch;
        flex-direction: column;
    }

    .promo-pesquisa {
        max-width: none;
    }

    .promo-status-filtro button {
        flex: 1;
    }

    .familias-titulo,
    .tratamentos-titulo {
        align-items: flex-start;
        flex-direction: column;
    }

    .vinculo-tipo {
        width: 100%;
    }
}
