/* ROTINAS */

.rotina-modal-scrim {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(10, 22, 17, 0.42);
}

.rotina-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: 67%;
    height: 80vh;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -48%) scale(0.98);
    transition: opacity 160ms ease, transform 160ms ease;
    overflow: hidden;
}

.rotina-open .rotina-modal {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.rotina-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.rotina-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--brand-dark);
    font-size: 1.1rem;
}

/* .rotina-modal-body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
    padding: 30px;
    overflow-y: auto;
} */

.rotina-modal-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.grupo-rotinas{
    margin-top: -2px;
}

.grupo-rotinas h3 {
    color: #005f46;
    border-top: 1px solid #55555564;
    padding: 25px 0 0 0;
    margin: 0 35px;
}

.exec-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 30px 40px 30px;
}

.rotina-modal-body img {
    display: block;
    width: min(320px, 100%);
    max-height: min(320px, calc(100vh - 150px));
    object-fit: contain;
}

.exec-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    height: 100px;
    width: 300px;
    padding: 10px 14px;
    color: #505c56;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(19, 40, 31, 0.05);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.exec-card strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
    color: #101010;
}

.exec-card:hover strong {
    color: #007f5f;
}

.exec-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.exec-card:hover,
.exec-card:focus-visible {
    border-color: #007f5f73;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: #007f5f;
}

.icon-exec-wrap {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 8px;
}

.icon-exec-wrap img {
    display: block;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.icon-exec-wrap svg {
    display: block;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.icon-exec-wrap p {
    margin: 0;
    font-size: 12px;
}

/* MODAL EXECUCAO */

.modal-confirma {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000a0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.confirma-conteudo {
    background: #f2f2ee;
    padding: 20px;
    border-radius: 8px;
    width: 95%;
    max-width: 600px;
}

.confirma-descricao {
    text-align: center;
}

.tipo-execucao {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #5555557d;
    color: #005f46;
    padding-bottom: 10px;
}

.tipo-execucao div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.historico-exec {
    padding: 3px 4px 0 4px;
    border: 1px solid #55555543;
    background-color: #2222220f;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(19, 40, 31, 0.07);
    transition: transform 300ms ease, border-color 160ms ease, box-shadow 300ms ease;
}

.historico-exec:hover {
    border-color: rgba(45, 60, 56, 0.45);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.confirma-texto{
    font-size: 20px;
    color: #005f46;
}

.confirma-subtexto {
    font-size: 14px;
    background: #fff;
    border: 1px solid #55555543;
    border-radius: 8px;
    padding: 10px;
    margin: 0 22px;

}

.confirma-infos{
    padding: 10px 0 5px 0;
}

.confirma-sim-nao{
    display: flex;
    justify-content: center;
    gap: 40px;
}

.confirma-sim {
    background-color: #00995D;
    color: #ffffff;
    font-weight: 600;
    border: none;
    height: 42px;
    width: 120px;
    padding: 0;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    overflow: hidden;
}

.confirma-sim:hover {
    background-color: #00cf7c;
}

.confirma-sim:disabled {
    cursor: not-allowed;
}

.confirma-sim .confirma-aguarde {
    display: none;
    width: 100%;
    height: 100%;
}

.confirma-sim img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    
}

.confirma-sim:disabled .confirma-executar {
    display: none;
}

.confirma-sim:disabled .confirma-aguarde {
    display: block;
}

.confirma-nao {
    margin-left: 10px;
    height: 42px;
    width: 120px;
    border-radius: 5px;
    border: 1px solid #aeaeae;
    background-color: #5f5f5f;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.confirma-nao:hover{
    background-color: #f8f8f8;
    color: #292929;
    border: 1px solid #888888;
}

.resultado-execucao {
    min-height: 35px;
    margin: 0 0 20px 0;
}

.exec-mensagem{
    width: 100%;
    color: #fff;
    text-align: center;
    border-radius: 25px;
    padding: 8px;
}

.exec-success {
    background: #02906a;
}

.exec-danger {
    background: #e33939;
}

/* HISTÓRICO */

.historico-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000a0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.historico-card {
    display: flex;
    flex-direction: column;
    background: #f2f2ee;
    padding: 20px;
    border-radius: 8px;
    width: 96%;
    max-width: 610px;
    /* min-height: 400px; */
}

.icon-historico-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #005f46;
    padding-bottom: 10px;
    gap: 10px;
}

.icon-historico-wrap span{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.dados-historico {
    display: flex;
    flex-direction: column;
    color: #333333;
    height: 300px;
    width: 100%;
    gap: 8px;
    overflow-y: auto;
}

.cabeca-historico {
    display: flex;
    justify-content: space-between;
    border: 1px solid #5555557d;
    padding: 6px 0 4px 0;
}

.ds-historico{
    font-size: 13px;
    border-bottom: 1px solid #505c56;
    padding-bottom: 5px;
}

.hdata{
    width: 15%;
}

.huser{
    width: 20%;
}

.hparam{
    width: 39%;
}

.hqtd{
    width: 13%;
}

.htime{
    width: 13%;
}

.historico-btn {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    margin-top: 25px;
}

.historico-ok {
    padding: 10px 25px;
    border-radius: 5px;
    border: 1px solid #aeaeae;
    background-color: #5f5f5f;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.historico-ok:hover{
    background-color: #f8f8f8;
    color: #292929;
    border: 1px solid #888888;
}

@media (max-width: 1020px) {

}

@media (max-width: 600px) {

    .exec-card {
        width: 292px;
    }

    .rotina-modal {
        width: 90%;
    }

}
