:root {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: #f5f7fb;
    background: #0b1020;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top left,
            #1b2a52,
            transparent 35%
        ),
        #0b1020;
}

.container {
    width: min(1180px, 92%);
    margin: 0 auto;
    padding: 48px 0;
}

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

.eyebrow {
    margin: 0 0 8px;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: #7aa2ff;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4rem);
}

.subtitulo {
    margin: 8px 0 0;
    color: #9ca8c7;
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #2a365e;
    border-radius: 999px;
    background: rgba(17, 25, 52, 0.8);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.ocioso {
    background: #8993ad;
    box-shadow: 0 0 14px #8993ad;
}

.status-dot.executando {
    background: #39d98a;
    box-shadow: 0 0 14px #39d98a;
}

.status-dot.pausado {
    background: #f7c948;
    box-shadow: 0 0 14px #f7c948;
}

.status-dot.erro {
    background: #ff5c5c;
    box-shadow: 0 0 14px #ff5c5c;
}

.cards {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.card,
.painel {
    border: 1px solid #273257;
    border-radius: 22px;

    background:
        linear-gradient(
            145deg,
            rgba(28, 39, 76, 0.92),
            rgba(14, 21, 44, 0.92)
        );

    box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.22);
}

.card {
    padding: 24px;
}

.card h3 {
    display: block;
    margin: 0 0 14px;
    color: #9ca8c7;
    font-size: 1rem;
}

.card h1 {
    margin: 0;
    font-size: 2.4rem;
    color: #ffffff;
}

.card.destaque {
    border-color: #5a4ed8;
}

.grade-detalhes {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.painel {
    padding: 28px;
}

.painel h2 {
    margin-top: 0;
    color: #9ca8c7;
    font-size: 1rem;
}

.painel h3 {
    margin-bottom: 12px;
    font-size: 1.35rem;
}

.painel p {
    color: #c3cbe0;
}

.painel a {
    display: inline-block;
    margin-top: 10px;
    color: #8eb0ff;
    text-decoration: none;
}

.painel a:hover {
    text-decoration: underline;
}

.linha-status {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #273257;
}

.linha-status:last-of-type {
    border-bottom: 0;
}

.linha-status span {
    color: #9ca8c7;
}

.linha-status strong {
    text-align: right;
    text-transform: capitalize;
}

.erro-container {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #8d3b4c;
    border-radius: 14px;
    background: rgba(120, 28, 48, 0.25);
}

.erro-container span {
    display: block;
    margin-bottom: 8px;
    color: #ff9cad;
}

.erro-container strong {
    overflow-wrap: anywhere;
}

.oculto {
    display: none !important;
}

.painel-sistema {
    margin-top: 18px;
}

.cabecalho-painel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.cabecalho-painel h2 {
    margin-bottom: 6px;
}

.cabecalho-painel p {
    margin: 0;
}

.sistema-alerta {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #34436f;
    background: #151f3e;
    color: #c5cdea;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.sistema-alerta.saudavel {
    border-color: #287a58;
    background: rgba(34, 128, 88, 0.2);
    color: #72e6ac;
}

.sistema-alerta.alerta {
    border-color: #9c7428;
    background: rgba(178, 126, 24, 0.18);
    color: #ffd36b;
}

.sistema-alerta.critico {
    border-color: #9b3b50;
    background: rgba(173, 44, 72, 0.2);
    color: #ff9caf;
}

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

.metrica {
    padding: 20px;
    border: 1px solid #273257;
    border-radius: 18px;
    background: rgba(10, 16, 35, 0.45);
}

.metrica-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.metrica-topo span {
    color: #cbd3eb;
    font-weight: 700;
}

.metrica-topo strong {
    font-size: 1.15rem;
}

.barra {
    width: 100%;
    height: 12px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #0a1022;
    border: 1px solid #263054;
}

.barra-preenchimento {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            #4f7cff,
            #6a5cff
        );

    transition:
        width 0.5s ease,
        background 0.3s ease;
}

.barra-preenchimento.alerta {
    background:
        linear-gradient(
            90deg,
            #e4a72c,
            #f3c44e
        );
}

.barra-preenchimento.critico {
    background:
        linear-gradient(
            90deg,
            #e24f63,
            #ff6d7e
        );
}

.metrica small {
    display: block;
    margin-top: 10px;
    color: #8f9aba;
}

.metrica-descricao {
    margin: 14px 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

@media (max-width: 820px) {
    .topo,
    .cabecalho-painel {
        flex-direction: column;
    }

    .grade-detalhes,
    .metricas-sistema {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 28px 0;
    }
}
/* ===========================
   PIPELINE
=========================== */

.pipeline-card {
    background: #182347;
    border-radius: 18px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

#pipeline-percentual{
    font-size:22px;
    font-weight:bold;
    color:#7c8cff;
}

.barra-pipeline{
    width:100%;
    height:12px;
    background:#0f1733;
    border-radius:30px;
    overflow:hidden;
    margin-bottom:30px;
}

.barra-preenchida{
    height:100%;
    width:0%;
    background:linear-gradient(
        90deg,
        #4f6cff,
        #8d6cff
    );
    transition:.4s;
}


.pipeline-etapas {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.pipeline-item {
    width: 100%;
    min-width: 0;
    min-height: 92px;
    padding: 10px;
    background: #101936;
    border: 1px solid transparent;
    border-radius: 14px;
    transition: 0.3s;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pipeline-item h4 {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.pipeline-item span {
    font-size: 11px;
    opacity: 0.75;
}

.pipeline-item.aguardando {
    opacity: 0.55;
}

.pipeline-item.atual {
    border-color: #5b74ff;
    box-shadow: 0 0 15px rgba(91, 116, 255, 0.35);
}

.pipeline-item.concluida {
    border-color: #27d17f;
}

/* ================================
   HISTÓRICO DE EXECUÇÕES
================================ */

#historico-execucoes {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(280px, 1fr)
    );
    gap: 16px;
    margin-top: 20px;
}

.historico-item {
    background: #101936;
    border: 1px solid #28365f;
    border-radius: 16px;
    padding: 18px;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.historico-item:hover {
    transform: translateY(-3px);
    border-color: #5b74ff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.historico-topo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.historico-titulo {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    color: #ffffff;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.historico-status {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.historico-status.concluido {
    color: #54e5a4;
    background: rgba(39, 209, 127, 0.12);
    border: 1px solid rgba(39, 209, 127, 0.45);
}

.historico-status.erro {
    color: #ff6b85;
    background: rgba(255, 78, 113, 0.12);
    border: 1px solid rgba(255, 78, 113, 0.45);
}

.historico-status.executando {
    color: #91a4ff;
    background: rgba(91, 116, 255, 0.14);
    border: 1px solid rgba(91, 116, 255, 0.45);
}

.historico-detalhes {
    display: grid;
    gap: 9px;
    margin-bottom: 16px;
}

.historico-detalhes p {
    margin: 0;
    font-size: 13px;
    color: #aebbe3;
}

.historico-erro {
    padding: 10px 12px;
    border-radius: 10px;
    color: #ff9aae;
    background: rgba(255, 78, 113, 0.08);
    border: 1px solid rgba(255, 78, 113, 0.25);
    overflow-wrap: anywhere;
}

.historico-acoes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.historico-data {
    font-size: 12px;
    color: #8290bc;
}

.historico-botao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: #5068e8;
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.historico-botao:hover {
    transform: translateY(-1px);
    background: #6179ff;
}

@media (max-width: 720px) {
    #historico-execucoes {
        grid-template-columns: 1fr;
    }

    .historico-topo {
        flex-direction: column;
    }

    .historico-acoes {
        align-items: flex-start;
        flex-direction: column;
    }
}

    .historico-resumo {
    display: grid;
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
    gap: 14px;
    margin-top: 20px;
}

.historico-resumo-item {
    background: #101936;
    border: 1px solid #28365f;
    border-radius: 14px;
    padding: 16px;
}

.historico-resumo-item span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #95a3cf;
}

.historico-resumo-item strong {
    font-size: 24px;
    color: #ffffff;
}

@media (max-width: 720px) {
    .historico-resumo {
        grid-template-columns: 1fr;
    }
}

/* Pipeline horizontal responsivo */
.pipeline-card {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
}

.grade-detalhes .pipeline-card {
    grid-column: 1 / -1;
}

@media (max-width: 1100px) {
    .pipeline-etapas {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .pipeline-etapas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .pipeline-etapas {
        grid-template-columns: 1fr;
    }
}
/* =================================
   LAYOUT PRINCIPAL CORRIGIDO
================================= */

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.grade-detalhes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.pipeline-card {
    width: 100%;
    min-width: 0;
    margin-top: 18px;
    padding: 24px;
    overflow: hidden;
}

.pipeline-etapas {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 10px;
    width: 100%;
}

.pipeline-item {
    width: 100%;
    min-width: 0;
    min-height: 90px;
    padding: 12px 8px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: #101936;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pipeline-item h4 {
    margin: 0 0 7px;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.pipeline-item span {
    font-size: 11px;
    opacity: 0.75;
}

@media (max-width: 1050px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pipeline-etapas {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    .cards,
    .grade-detalhes {
        grid-template-columns: 1fr;
    }

    .pipeline-etapas {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}