.history-page {
    max-width: 1500px;
    margin: 0 auto;
    color: #eef4f8;
}

.history-heading,
.history-pagination,
.history-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.history-heading h1 {
    margin: 4px 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.history-heading p {
    margin: 0;
    color: rgba(238, 244, 248, .66);
}

.history-kicker {
    color: #d8b000 !important;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .18em;
}

.history-filters {
    display: grid;
    grid-template-columns: 1.5fr 1.35fr 1fr 1.15fr 1.15fr auto auto;
    gap: 12px;
    margin: 28px 0 18px;
    padding: 18px;
    border: 1px solid rgba(216, 176, 0, .2);
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
}

.history-filters label {
    display: grid;
    gap: 7px;
    color: rgba(238, 244, 248, .65);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.history-filters input,
.history-filters select {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: #0a1724;
    color: #eef4f8;
}

.history-primary-button,
.history-secondary-button,
.history-detail-button {
    align-self: end;
    padding: 11px 16px;
    border: 1px solid rgba(216, 176, 0, .55);
    border-radius: 8px;
    background: #d8b000;
    color: #07111d;
    cursor: pointer;
    font-weight: 700;
}

.history-secondary-button,
.history-detail-button {
    background: transparent;
    color: #e7c743;
}

.history-secondary-button:disabled {
    cursor: not-allowed;
    opacity: .35;
}

.history-feedback {
    min-height: 24px;
    color: #7dff9b;
    font-size: .85rem;
}

.history-feedback-error {
    color: #ff8c8c;
}

.history-table-panel {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(4, 12, 20, .62);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.history-table th,
.history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    text-align: left;
    white-space: nowrap;
}

.history-table th {
    color: #d8b000;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.history-table code {
    color: #94d8ff;
}

.history-table tbody tr:hover {
    background: rgba(216, 176, 0, .05);
}

.history-empty {
    padding: 50px !important;
    color: rgba(238, 244, 248, .55);
    text-align: center !important;
}

.history-pagination {
    margin-top: 16px;
    color: rgba(238, 244, 248, .65);
}

.history-operation-log {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid rgba(216, 176, 0, .2);
}

.history-operation-log__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.history-operation-log__heading h2 {
    margin: 4px 0 7px;
    color: #eef4f8;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.history-operation-log__heading p {
    margin: 0;
    color: rgba(238, 244, 248, .58);
}

.history-operation-log__total {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid rgba(216, 176, 0, .28);
    border-radius: 999px;
    color: #e7c743;
    background: rgba(216, 176, 0, .06);
    font-size: .76rem;
    font-weight: 700;
}

.history-operation-log__table td {
    vertical-align: top;
}

.history-operation-name {
    max-width: 240px;
    white-space: normal !important;
    color: #e7c743;
}

.history-operation-text {
    min-width: 280px;
    max-width: 520px;
    white-space: pre-wrap !important;
    line-height: 1.5;
}

.history-dialog {
    width: min(920px, 94vw);
    max-height: 88vh;
    padding: 0;
    overflow: auto;
    border: 1px solid rgba(216, 176, 0, .4);
    border-radius: 14px;
    background: #081522;
    color: #eef4f8;
}

.history-dialog::backdrop {
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(4px);
}

.history-dialog-heading button {
    border: 0;
    background: transparent;
    color: #eef4f8;
    cursor: pointer;
    font-size: 1.8rem;
}

.history-dialog-heading {
    position: sticky;
    z-index: 4;
    top: 0;
    padding: 17px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(8, 21, 34, .96);
    backdrop-filter: blur(10px);
}

.history-dialog-heading h2 {
    margin: 0;
    color: #eef4f8;
    font-size: 1.05rem;
}

.history-message-detail {
    min-width: 0;
}

.history-detail-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border-bottom: 1px solid rgba(216, 176, 0, .2);
    background:
        linear-gradient(135deg, rgba(216, 176, 0, .09), transparent 54%),
        rgba(255, 255, 255, .018);
}

.history-detail-node-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(92, 197, 255, .42);
    border-radius: 14px;
    color: #8ed9ff;
    background: rgba(92, 197, 255, .09);
    font-size: 2rem;
}

.history-detail-summary p {
    margin: 0 0 4px;
    color: #d8b000;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .13em;
}

.history-detail-summary h3 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #eef4f8;
    font-size: 1.2rem;
}

.history-detail-summary div > span {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: rgba(238, 244, 248, .58);
    font-size: .76rem;
}

.history-detail-status {
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: rgba(238, 244, 248, .68);
    font-size: .7rem;
    white-space: nowrap;
}

.history-detail-status.is-online {
    border-color: rgba(99, 255, 138, .35);
    color: #7dff9b;
    background: rgba(99, 255, 138, .07);
}

.history-detail-status.is-offline {
    border-color: rgba(255, 120, 111, .36);
    color: #ff9292;
    background: rgba(255, 120, 111, .07);
}

.history-detail-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px 22px 24px;
}

.history-detail-section {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 11px;
    background: rgba(3, 10, 16, .32);
}

.history-detail-section--message,
.history-technical-details {
    grid-column: 1 / -1;
}

.history-detail-section h3 {
    margin: 0 0 13px;
    color: #d8b000;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.history-detail-message {
    margin: 0;
    overflow-wrap: anywhere;
    color: #eef4f8;
    font-size: .95rem;
    line-height: 1.65;
    white-space: pre-wrap;
}

.history-detail-grid {
    display: grid;
    gap: 0;
    margin: 0;
}

.history-detail-grid > div {
    display: grid;
    grid-template-columns: minmax(100px, .42fr) minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.history-detail-grid > div:first-child {
    padding-top: 0;
}

.history-detail-grid > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.history-detail-grid dt {
    color: rgba(238, 244, 248, .54);
    font-size: .68rem;
    font-weight: 700;
    text-transform: capitalize;
}

.history-detail-grid dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #eef4f8;
    font-size: .76rem;
    font-weight: 650;
    line-height: 1.45;
    text-align: right;
    white-space: pre-wrap;
}

.history-technical-details {
    border: 1px solid rgba(92, 197, 255, .14);
    border-radius: 10px;
    background: rgba(3, 10, 16, .22);
}

.history-technical-details summary {
    padding: 13px 15px;
    color: #94d8ff;
    cursor: pointer;
    font-size: .74rem;
    font-weight: 700;
}

.history-technical-details pre {
    max-height: 300px;
    margin: 0 12px 12px;
    padding: 15px;
    overflow: auto;
    border-radius: 8px;
    background: #030a10;
    color: #a9dcff;
    font-size: .72rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.scc-menu-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}

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

@media (max-width: 760px) {
    .history-heading,
    .history-pagination,
    .history-operation-log__heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-filters {
        grid-template-columns: 1fr;
    }

    .history-detail-summary {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .history-detail-status {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .history-detail-content {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .history-detail-section--message,
    .history-technical-details {
        grid-column: auto;
    }

    .history-detail-grid > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .history-detail-grid dd {
        text-align: left;
    }
}
