/* Cenas animadas da documentação Interface e Agentes */

.docs-stage {
    --ds-navy: #0D2142;
    --ds-teal: #00B5CC;
    --ds-teal-light: #26C6DA;
    --ds-blue: #1976D2;
    --ds-muted: #5d6a7d;
    --ds-bg: #f4f8fb;
    --ds-card: #ffffff;
    --ds-border: #e3ecf4;
    --ds-ok: #2e7d32;
    --ds-warn: #ef6c00;
    --ds-err: #c62828;
    --ds-grad: linear-gradient(90deg, #26C6DA 0%, #1976D2 100%);
    position: relative;
    margin: 28px 0 12px;
    padding: 18px;
    border-radius: 16px;
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    box-shadow: 0 8px 28px rgba(13, 33, 66, 0.06);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}

.docs-stage__caption {
    margin: 16px 0 0;
    min-height: 2.6em;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ds-navy);
    font-weight: 600;
}

.docs-stage::after {
    content: attr(data-hint);
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-muted);
    opacity: 0.75;
}

/* ---- Mapa ---- */
.docs-map {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 14px;
    align-items: stretch;
}

.docs-map__nav {
    background: var(--ds-navy);
    color: #fff;
    border-radius: 12px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.docs-map__brand {
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
    padding: 0 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 4px;
}

.docs-map__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 9px 10px;
    border-radius: 8px;
    transition: background 0.25s ease, color 0.25s ease;
    pointer-events: none;
}

.docs-map__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    flex-shrink: 0;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.docs-map__item.is-on {
    background: rgba(0, 181, 204, 0.22);
    color: #fff;
}

.docs-map__item.is-on .docs-map__dot {
    background: var(--ds-teal-light);
    box-shadow: 0 0 0 4px rgba(38, 198, 218, 0.25);
}

.docs-map__panel {
    display: flex;
    align-items: center;
}

.docs-map__card {
    width: 100%;
    background: var(--ds-card);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 22px 20px;
    min-height: 140px;
    box-shadow: 0 4px 16px rgba(13, 33, 66, 0.05);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.docs-map__card.is-off {
    opacity: 0.35;
    transform: translateY(4px);
}

.docs-map__card strong {
    display: block;
    font-size: 1.15rem;
    color: var(--ds-navy);
    margin-bottom: 8px;
}

.docs-map__card p {
    margin: 0;
    color: var(--ds-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ---- Criar ---- */
.docs-create {
    position: relative;
    min-height: 220px;
}

.docs-create__empty,
.docs-create__models,
.docs-create__open {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.docs-create__empty.is-off,
.docs-create__models.is-off,
.docs-create__open.is-off {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.docs-create__empty {
    text-align: center;
    padding: 28px 16px 12px;
    background: var(--ds-card);
    border: 1px dashed var(--ds-border);
    border-radius: 12px;
}

.docs-create__empty strong {
    display: block;
    font-size: 1.15rem;
    color: var(--ds-navy);
    margin-bottom: 6px;
}

.docs-create__empty > span {
    display: block;
    color: var(--ds-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.docs-create__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.docs-create__btns span {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--ds-border);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ds-navy);
    background: #fff;
}

.docs-create__btns span.is-main {
    background: var(--ds-grad);
    color: #fff;
    border-color: transparent;
}

.docs-create__models {
    background: var(--ds-card);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 16px;
}

.docs-create__label {
    margin: 0 0 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ds-muted);
}

.docs-create__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.docs-create__card {
    padding: 14px 12px;
    border-radius: 10px;
    border: 2px solid var(--ds-border);
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.docs-create__card strong {
    display: block;
    font-size: 0.82rem;
    color: var(--ds-navy);
    margin-bottom: 6px;
    line-height: 1.35;
}

.docs-create__card small {
    color: var(--ds-muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.docs-create__card.is-on {
    border-color: var(--ds-blue);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
    transform: translateY(-2px);
}

.docs-create__open {
    text-align: center;
    padding: 28px 18px 16px;
    background: var(--ds-card);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
}

.docs-create__badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0, 181, 204, 0.12);
    color: var(--ds-teal);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.docs-create__open strong {
    display: block;
    font-size: 1.2rem;
    color: var(--ds-navy);
    margin-bottom: 6px;
}

.docs-create__open p {
    margin: 0 0 12px;
    color: var(--ds-muted);
    font-size: 0.92rem;
}

.docs-create__link {
    color: var(--ds-teal);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    pointer-events: auto;
}

.docs-create__link:hover {
    color: var(--ds-blue);
}

/* ---- Executar ---- */
.docs-run__toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.docs-run__btn {
    border: 1px solid var(--ds-border);
    background: #fff;
    color: var(--ds-navy);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 8px 14px;
    border-radius: 8px;
    pointer-events: none;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.docs-run__btn.is-on {
    background: var(--ds-grad);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(0, 181, 204, 0.28);
}

.docs-run__flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.docs-run__node {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: #fff;
    border: 2px solid var(--ds-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.docs-run__node span {
    font-weight: 800;
    color: var(--ds-navy);
    font-size: 1.1rem;
}

.docs-run__node small {
    font-size: 0.7rem;
    color: var(--ds-muted);
    font-weight: 600;
}

.docs-run__node.is-on {
    border-color: var(--ds-teal);
    box-shadow: 0 0 0 4px rgba(0, 181, 204, 0.18);
    transform: scale(1.05);
}

.docs-run__node.is-done {
    border-color: var(--ds-ok);
    background: #e8f5e9;
}

.docs-run__arrow {
    width: 28px;
    height: 3px;
    background: var(--ds-border);
    border-radius: 2px;
    position: relative;
    transition: background 0.3s ease;
}

.docs-run__arrow::after {
    content: "";
    position: absolute;
    right: -2px;
    top: -3px;
    border: 5px solid transparent;
    border-left-color: var(--ds-border);
    transition: border-left-color 0.3s ease;
}

.docs-run__arrow.is-on {
    background: var(--ds-teal);
}

.docs-run__arrow.is-on::after {
    border-left-color: var(--ds-teal);
}

.docs-run__job {
    background: #fff;
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 14px 16px;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.docs-run__job.is-off {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    height: 0;
    padding: 0 16px;
    border: 0;
    overflow: hidden;
}

.docs-run__job-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.docs-run__job-top strong {
    color: var(--ds-navy);
}

.docs-run__status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs-run__status.is-success {
    background: #e8f5e9;
    color: var(--ds-ok);
}

.docs-run__status.is-failed {
    background: #ffebee;
    color: var(--ds-err);
}

.docs-run__status.is-running {
    background: #e3f2fd;
    color: var(--ds-blue);
}

.docs-run__job p {
    margin: 0;
    color: var(--ds-muted);
    font-size: 0.88rem;
}

/* ---- Gatilho / validação ---- */
.docs-check__row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.docs-check__clock,
.docs-check__robot {
    background: #fff;
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 14px 18px;
    text-align: center;
    min-width: 110px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.docs-check__face {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ds-navy);
    font-variant-numeric: tabular-nums;
}

.docs-check__clock small,
.docs-check__robot small {
    color: var(--ds-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.docs-check__clock.is-on {
    border-color: var(--ds-teal);
    box-shadow: 0 0 0 4px rgba(0, 181, 204, 0.18);
}

.docs-check__robot strong {
    display: block;
    color: var(--ds-navy);
    margin-bottom: 2px;
}

.docs-check__robot.is-on {
    border-color: var(--ds-blue);
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.15);
}

.docs-check__pipe {
    width: 40px;
    height: 3px;
    background: var(--ds-border);
    border-radius: 2px;
    position: relative;
    transition: background 0.3s ease;
}

.docs-check__pipe.is-on {
    background: var(--ds-grad);
}

.docs-check__val {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 14px;
}

.docs-check__pdf {
    width: 56px;
    height: 68px;
    border-radius: 8px;
    background: linear-gradient(160deg, #ffe082, #ffb74d);
    color: #5d4037;
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 183, 77, 0.35);
    transition: transform 0.3s ease;
}

.docs-check__pdf.is-on {
    transform: scale(1.06);
}

.docs-check__reads {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.docs-check__read {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--ds-bg);
    border: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.docs-check__read span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ds-muted);
}

.docs-check__read strong {
    font-size: 0.85rem;
    color: var(--ds-navy);
}

.docs-check__read.is-on {
    border-color: var(--ds-teal);
    background: rgba(0, 181, 204, 0.06);
}

.docs-check__verdict {
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.82rem;
    text-align: center;
    min-width: 110px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.docs-check__verdict.is-off {
    opacity: 0;
    transform: scale(0.92);
}

.docs-check__verdict.is-ok {
    background: #e8f5e9;
    color: var(--ds-ok);
}

.docs-check__verdict.is-warn {
    background: #fff8e1;
    color: var(--ds-warn);
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .docs-map {
        grid-template-columns: 1fr;
    }

    .docs-create__cards {
        grid-template-columns: 1fr;
    }

    .docs-check__val {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .docs-check__reads {
        width: 100%;
    }

    .docs-stage::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .docs-stage *,
    .docs-stage *::before,
    .docs-stage *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* Dark theme */
body.dark .docs-stage,
body.curator-theme.dark .docs-stage {
    --ds-bg: #121a28;
    --ds-card: #1a2436;
    --ds-border: #2a3a52;
    --ds-muted: #9aabc0;
    --ds-navy: #e8eef6;
}

body.dark .docs-map__nav,
body.curator-theme.dark .docs-map__nav {
    background: #0a1424;
}

body.dark .docs-create__btns span,
body.dark .docs-run__btn,
body.dark .docs-run__node,
body.dark .docs-check__clock,
body.dark .docs-check__robot,
body.dark .docs-check__val,
body.dark .docs-run__job,
body.dark .docs-create__empty,
body.dark .docs-create__models,
body.dark .docs-create__open,
body.dark .docs-map__card,
body.curator-theme.dark .docs-create__btns span,
body.curator-theme.dark .docs-run__btn,
body.curator-theme.dark .docs-run__node,
body.curator-theme.dark .docs-check__clock,
body.curator-theme.dark .docs-check__robot,
body.curator-theme.dark .docs-check__val,
body.curator-theme.dark .docs-run__job,
body.curator-theme.dark .docs-create__empty,
body.curator-theme.dark .docs-create__models,
body.curator-theme.dark .docs-create__open,
body.curator-theme.dark .docs-map__card {
    background: var(--ds-card);
    color: var(--ds-navy);
}

body.dark .docs-create__card,
body.curator-theme.dark .docs-create__card {
    background: #121a28;
}

body.dark .docs-check__read,
body.curator-theme.dark .docs-check__read {
    background: #121a28;
}

body.dark .docs-run__node.is-done,
body.curator-theme.dark .docs-run__node.is-done {
    background: rgba(46, 125, 50, 0.2);
}
