/* Tables, operations status and data-retention settings. */
/* ===== 表格滚动 ===== */
.ant-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.ant-table-wrapper .ant-table-content,
.ant-table-wrapper .ant-table-body {
    scrollbar-width: thin;
    scrollbar-color: var(--fx-border) transparent;
}

.ant-table-wrapper .ant-table-content {
    overflow-x: auto !important;
    overflow-y: hidden;
}

.ant-table-wrapper .ant-table-body {
    overflow-x: auto !important;
}

.ant-table-wrapper .ant-table-content::-webkit-scrollbar,
.ant-table-wrapper .ant-table-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ant-table-wrapper .ant-table-content::-webkit-scrollbar-thumb,
.ant-table-wrapper .ant-table-body::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: var(--fx-border);
}

/* 表格增强 ===== */
.ant-table-wrapper .ant-table {
    border-radius: 8px;
    overflow: hidden;
}

.ant-table-wrapper .ant-table-thead > tr > th {
    background: var(--fx-panel-muted) !important;
    color: var(--fx-text) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-bottom: 2px solid var(--fx-border) !important;
    padding: 8px 12px !important;
}

.ant-table-wrapper .ant-table-tbody > tr > td {
    border-bottom: 1px solid var(--fx-border) !important;
    padding: 10px 12px !important;
    transition: background 0.15s ease;
}

.ant-table-wrapper .ant-table-tbody > tr:hover > td,
.ant-table-wrapper .ant-table-tbody > tr.ant-table-row-hover > td {
    background: var(--fx-nav-hover) !important;
}

/* 斑马纹（可选，通过 table-striped 类启用） */
.ant-table-wrapper .ant-table-tbody > tr:nth-child(even) > td {
    background: color-mix(in srgb, var(--fx-panel-muted) 50%, transparent);
}

.ant-table-wrapper .ant-table-tbody > tr:nth-child(even):hover > td {
    background: var(--fx-nav-hover) !important;
}

.ant-table-wrapper .ant-pagination {
    margin: 16px 0 0 !important;
    color: var(--fx-text-muted) !important;
}

.ant-table-wrapper .ant-pagination-item,
.ant-table-wrapper .ant-pagination-prev,
.ant-table-wrapper .ant-pagination-next {
    background: var(--fx-panel) !important;
    border: 1px solid var(--fx-border) !important;
}

.ant-table-wrapper .ant-pagination-item a {
    color: var(--fx-text) !important;
}

.ant-table-wrapper .ant-pagination-item-active {
    background: var(--fx-primary) !important;
    border-color: var(--fx-primary) !important;
}

.ant-table-wrapper .ant-pagination-item-active a {
    color: #ffffff !important;
}

.table-panel {
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-lg);
    padding: var(--fx-space-3);
    box-shadow: var(--fx-elevation-sm);
    transition:
        background-color var(--fx-theme-transition),
        border-color var(--fx-theme-transition),
        color var(--fx-theme-transition),
        box-shadow 0.2s ease;
}

.table-panel h2 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--fx-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-panel h2 .anticon {
    color: var(--fx-primary);
}

.settings-tabs .ant-tabs-content-holder {
    min-width: 0;
}

.operations-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
    padding: 16px 18px;
    border: 1px solid var(--fx-border);
    border-left: 4px solid var(--fx-success);
    border-radius: var(--fx-radius-lg);
    background: color-mix(in srgb, var(--fx-success) 7%, var(--fx-panel));
}

.operations-hero.operations-status-degraded {
    border-left-color: var(--fx-warning);
    background: color-mix(in srgb, var(--fx-warning) 7%, var(--fx-panel));
}

.operations-hero.operations-status-unhealthy {
    border-left-color: var(--fx-error);
    background: color-mix(in srgb, var(--fx-error) 7%, var(--fx-panel));
}

.operations-title-row,
.operations-hero-actions,
.operations-service-card > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.operations-title-row h2 {
    margin: 0;
    color: var(--fx-text);
    font-size: 20px;
}

.operations-hero p,
.operations-hero-actions small,
.operations-resource-card small,
.operations-service-card span,
.operations-service-card small {
    color: var(--fx-text-muted);
}

.operations-hero p {
    margin: 5px 0 0;
}

.operations-hero-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.operations-resource-grid,
.operations-service-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.operations-resource-card,
.operations-service-card {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-md);
    background: var(--fx-panel-muted);
}

.operations-resource-card {
    display: grid;
    gap: 4px;
}

.operations-resource-card > span {
    color: var(--fx-text-muted);
    font-size: 12px;
}

.operations-resource-card > strong {
    color: var(--fx-text);
    font-size: 22px;
    line-height: 1.25;
}

.operations-progress {
    height: 5px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--fx-text-muted) 18%, transparent);
}

.operations-progress-bar {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: var(--fx-success);
    transition: width .25s ease;
}

.operations-progress-degraded {
    background: var(--fx-warning);
}

.operations-progress-unhealthy {
    background: var(--fx-error);
}

.operations-service-card {
    display: grid;
    gap: 5px;
    align-content: start;
}

.operations-service-card > div {
    justify-content: space-between;
}

.operations-service-card strong {
    color: var(--fx-text);
}

.operations-service-card small {
    font-size: 12px;
}

.operations-ingestion-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.data-maintenance-panel {
    display: grid;
    gap: 14px;
}

.data-retention-policy-panel {
    display: grid;
    gap: 14px;
}

.system-policy-panel {
    margin-bottom: 12px;
}

.data-retention-policy-panel .panel-title-row,
.data-retention-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.data-retention-schedule {
    flex: none;
    padding-top: 2px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.data-retention-grid {
    overflow: hidden;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-md);
}

.data-retention-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 110px 150px;
    align-items: center;
    gap: 16px;
    min-height: 66px;
    padding: 10px 14px;
    background: var(--fx-panel);
}

.data-retention-row + .data-retention-row {
    border-top: 1px solid var(--fx-border);
}

.data-retention-name,
.data-retention-status {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.data-retention-name strong {
    color: var(--fx-text);
    font-weight: 600;
}

.data-retention-name small,
.data-retention-status,
.data-retention-enabled,
.data-retention-days {
    color: var(--fx-text-muted);
}

.data-retention-enabled,
.data-retention-days {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-retention-footer {
    align-items: center;
}

.data-retention-status {
    font-size: 12px;
}

.data-retention-error {
    color: var(--fx-error);
}

.data-storage-usage-panel {
    display: grid;
    gap: 12px;
}

.data-storage-usage-panel .panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.data-storage-total {
    display: grid;
    grid-template-columns: auto minmax(120px, auto) 1fr;
    gap: 8px 16px;
    align-items: baseline;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--fx-primary) 36%, var(--fx-border));
    border-radius: var(--fx-radius-md);
    background: color-mix(in srgb, var(--fx-primary) 7%, var(--fx-panel));
}

.data-storage-total > span {
    color: var(--fx-text-muted);
}

.data-storage-total > strong {
    color: var(--fx-text);
    font-size: 26px;
    font-weight: 600;
}

.data-storage-total > small {
    color: var(--fx-text-muted);
}

.data-maintenance-panel .panel-title-row h2 {
    margin-bottom: 2px;
}

.data-maintenance-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.data-maintenance-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    min-height: 34px;
}

.data-maintenance-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

.data-maintenance-result .detail-list {
    grid-template-columns: 130px minmax(0, 1fr);
}

.data-maintenance-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.data-maintenance-summary-item {
    display: flex;
    min-width: 0;
    min-height: 112px;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
    border: 1px solid var(--fx-border);
    border-left: 3px solid var(--fx-primary);
    border-radius: var(--fx-radius-md);
    background: var(--fx-panel-muted);
}

.data-maintenance-summary-item > span,
.data-maintenance-summary-item > small,
.data-maintenance-latest-note {
    color: var(--fx-text-muted);
}

.data-maintenance-summary-item > strong {
    margin: 4px 0;
    color: var(--fx-text);
    font-size: 24px;
    font-weight: 600;
}

.data-maintenance-summary-item > small {
    line-height: 1.6;
}

.data-maintenance-latest-note {
    margin-top: 12px;
}

@media (max-width: 900px) {
    .operations-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .operations-hero-actions {
        justify-content: flex-start;
    }

    .operations-resource-grid,
    .operations-service-grid,
    .operations-ingestion-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .data-retention-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .data-retention-days {
        grid-column: 1 / -1;
    }

    .data-retention-policy-panel .panel-title-row,
    .data-retention-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .data-maintenance-form {
        grid-template-columns: 1fr;
    }

    .data-maintenance-summary {
        grid-template-columns: 1fr;
    }

    .data-storage-total {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .data-maintenance-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .operations-resource-grid,
    .operations-service-grid,
    .operations-ingestion-grid {
        grid-template-columns: 1fr;
    }
}
