.ae-monitor {
    --ae-monitor-ink: #172433;
    --ae-monitor-muted: #667085;
    --ae-monitor-line: #d9e0e8;
    --ae-monitor-bg: #f5f7fa;
    --ae-monitor-card: #ffffff;
    --ae-monitor-dark: #1f2d3d;
    --ae-monitor-blue: #2271b1;
    width: calc(100vw - 48px);
    max-width: 1720px;
    margin-left: 50%;
    transform: translateX(-50%);
    padding: 26px;
    background: var(--ae-monitor-bg);
    color: var(--ae-monitor-ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ae-monitor * {
    box-sizing: border-box;
    letter-spacing: 0;
}

.ae-monitor-live-updating {
    opacity: .78;
    transition: opacity .18s ease;
}

.ae-monitor-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 22px;
}

.ae-monitor-head p {
    margin: 0 0 4px;
    color: var(--ae-monitor-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ae-monitor-head h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.1;
}

.ae-monitor-head span {
    color: var(--ae-monitor-muted);
    font-weight: 700;
    text-align: right;
}

.ae-monitor-head-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.ae-monitor-main-menu {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    padding: 10px 16px;
    background: var(--ae-monitor-blue);
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

.ae-monitor-main-menu:hover {
    background: #155d91;
    color: #fff;
}

.ae-monitor-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.ae-monitor-metrics article,
.ae-monitor-section {
    background: var(--ae-monitor-card);
    border: 1px solid var(--ae-monitor-line);
    border-radius: 8px;
}

.ae-monitor-metrics article {
    padding: 18px;
}

.ae-monitor-metrics span {
    display: block;
    color: var(--ae-monitor-muted);
    font-size: 13px;
    font-weight: 800;
}

.ae-monitor-metrics strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

.ae-monitor-section {
    padding: 0;
    overflow: hidden;
    margin-bottom: 18px;
}

.ae-monitor-table-wrap {
    overflow-x: auto;
}

.ae-monitor-table {
    width: 100%;
    min-width: 1360px;
    border-collapse: collapse;
    table-layout: fixed;
}

.ae-monitor-table th {
    background: var(--ae-monitor-dark);
    color: white;
    text-align: left;
    padding: 15px 14px;
    font-size: 14px;
}

.ae-monitor-table th:nth-child(1),
.ae-monitor-table td:nth-child(1) {
    width: 13%;
}

.ae-monitor-table th:nth-child(2),
.ae-monitor-table td:nth-child(2),
.ae-monitor-table th:nth-child(5),
.ae-monitor-table td:nth-child(5) {
    width: 12%;
}

.ae-monitor-table th:nth-child(3),
.ae-monitor-table td:nth-child(3) {
    width: 9%;
}

.ae-monitor-table th:nth-child(4),
.ae-monitor-table td:nth-child(4) {
    width: 18%;
}

.ae-monitor-table th:nth-child(6),
.ae-monitor-table td:nth-child(6) {
    width: 12%;
}

.ae-monitor-table th:nth-child(7),
.ae-monitor-table td:nth-child(7) {
    width: 16%;
}

.ae-monitor-table th:nth-child(8),
.ae-monitor-table td:nth-child(8) {
    width: 7%;
}

.ae-monitor-table th:nth-child(9),
.ae-monitor-table td:nth-child(9) {
    width: 10%;
}

.ae-monitor-table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--ae-monitor-line);
    vertical-align: top;
}

.ae-monitor-table td small {
    display: block;
    margin-top: 4px;
    color: var(--ae-monitor-muted);
}

.ae-monitor-good,
.ae-monitor-warning,
.ae-monitor-danger,
.ae-monitor-muted {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 5px 11px;
    font-weight: 850;
}

.ae-monitor-good {
    background: #e9f8ef;
    color: #128a4a;
}

.ae-monitor-warning {
    background: #fff6db;
    color: #9a6700;
}

.ae-monitor-danger {
    background: #fdecee;
    color: #c6283d;
}

.ae-monitor-blocked {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 5px 11px;
    background: #222f3e;
    color: #ffffff;
    font-weight: 850;
}

.ae-monitor-muted {
    background: #eef1f4;
    color: #667085;
}

.ae-monitor-history summary {
    cursor: pointer;
    color: var(--ae-monitor-blue);
    font-weight: 850;
}

.ae-monitor-history div {
    margin-top: 10px;
    max-height: 240px;
    width: min(360px, 100%);
    overflow: auto;
    background: #f9fbfd;
    border: 1px solid var(--ae-monitor-line);
    border-radius: 6px;
    padding: 10px;
    line-height: 1.55;
}

.ae-monitor-history div div {
    width: auto;
    min-width: 0;
    max-height: none;
    margin: 0;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--ae-monitor-line);
    border-radius: 0;
    background: transparent;
}

.ae-monitor-history div div:last-child {
    border-bottom: 0;
}

.ae-monitor-action-form {
    margin: 0;
}

.ae-monitor-action,
.ae-monitor-action-muted {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 850;
}

.ae-monitor-action {
    border: 0;
    cursor: pointer;
}

.ae-monitor-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 6px;
    padding: 8px 12px;
    background: #2271b1;
    color: #ffffff;
    font-weight: 850;
    text-decoration: none;
}

.ae-monitor-action-suspend {
    background: #222f3e;
    color: #ffffff;
}

.ae-monitor-action-resume {
    background: #e9f8ef;
    color: #128a4a;
}

.ae-monitor-action-pause {
    background: #fff6db;
    color: #9a6700;
}

.ae-monitor-action-finish {
    background: #2271b1;
    color: #ffffff;
}

.ae-monitor-attempts,
.ae-monitor-logs {
    margin-top: 18px;
}

.ae-monitor-attempts header,
.ae-monitor-logs header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--ae-monitor-line);
}

.ae-monitor-attempts h2,
.ae-monitor-logs h2 {
    margin: 0;
    font-size: 22px;
}

.ae-monitor-attempts p,
.ae-monitor-logs p {
    margin: 5px 0 0;
    color: var(--ae-monitor-muted);
    font-weight: 700;
}

.ae-monitor-attempts-table {
    min-width: 980px;
}

.ae-monitor-logs-table {
    min-width: 1120px;
}

.ae-monitor-attempt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.ae-monitor-action-muted {
    background: #eef1f4;
    color: #667085;
}

.ae-monitor-alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 850;
}

.ae-monitor-alert-ok {
    background: #e9f8ef;
    color: #128a4a;
}

.ae-monitor-alert-error {
    background: #fdecee;
    color: #c6283d;
}

.ae-monitor-notice {
    max-width: 920px;
    margin: 24px auto;
    padding: 14px 16px;
    border-radius: 8px;
    background: #fff6e5;
    color: #8a5a00;
    font-weight: 800;
}

@media (max-width: 900px) {
    .ae-monitor {
        width: calc(100vw - 20px);
        padding: 18px;
    }

    .ae-monitor-head {
        display: block;
    }

    .ae-monitor-head-actions {
        align-items: flex-start;
        margin-top: 8px;
    }

    .ae-monitor-head span {
        display: block;
        text-align: left;
    }

    .ae-monitor-metrics {
        grid-template-columns: 1fr;
    }
}
