﻿/* ── Page header ─────────────────────────────────── */
.ris-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

/* ── Section panels ──────────────────────────────── */
.ris-section {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0 1.25rem 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

/* ── Collapsible section header ──────────────────── */
.ris-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 0 0.5rem;
    margin-bottom: 0.875rem;
    cursor: pointer;
    text-align: left;
}

    .ris-section-toggle:hover .ris-section-title {
        color: #495057;
    }

.ris-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin: 0;
    transition: color 0.15s;
}

/* collapsed state: remove bottom margin when body is hidden */
.ris-section:has(.ris-section-toggle:only-child) {
    padding-bottom: 0;
}

.ris-chevron {
    font-size: 1.1rem;
    color: #adb5bd;
    line-height: 1;
    transition: transform 0.2s ease;
    display: inline-block;
    transform: rotate(0deg);
}

.ris-chevron-open {
    transform: rotate(90deg);
}

/* ── Stats row ───────────────────────────────────── */
.ris-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.ris-stat-item {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 1.25rem 0.25rem 0;
    min-width: 80px;
}

.ris-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.15rem;
}

.ris-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #212529;
}

.ris-stat-divider {
    width: 1px;
    height: 2rem;
    background: #dee2e6;
    margin-right: 1.25rem;
    align-self: center;
    flex-shrink: 0;
}

.ris-val-success {
    color: #198754;
}

.ris-val-warning {
    color: #856404;
}

.ris-val-error {
    color: #dc3545;
}

.ris-status-completed {
    color: #198754;
}

.ris-status-running {
    color: #0d6efd;
}

.ris-status-failed {
    color: #dc3545;
}

.ris-status-pending {
    color: #856404;
}

/* ── Inline error alert ──────────────────────────── */
.ris-alert-error {
    background: #fff5f5;
    border: 1px solid #f5c2c7;
    border-radius: 4px;
    color: #842029;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 0.875rem;
}

/* ── Filter bar ──────────────────────────────────── */
.ris-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.ris-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 150px;
}

.ris-filter-label {
    font-size: 0.78rem;
    color: #6c757d;
}

.ris-filter-input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    color: #212529;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .ris-filter-input:focus {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
    }

.ris-clear-btn {
    align-self: flex-end;
}

.ris-results-summary {
    font-size: 0.82rem;
    color: #6c757d;
    margin: 0 0 0.75rem;
}

/* ── Table ───────────────────────────────────────── */
.ris-table-scroll {
}

.ris-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

    .ris-table thead tr {
        background: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
    }

.ris-th-sort {
    padding: 0.6rem 0.875rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

    .ris-th-sort:hover {
        background: #e9ecef;
    }

.ris-sort-icon {
    font-size: 0.65rem;
    color: #adb5bd;
    margin-left: 0.2rem;
}

.ris-tr {
    border-bottom: 1px solid #f1f3f5;
}

    .ris-tr:hover {
        background: #f8f9fa;
    }

.ris-table td {
    padding: 0.55rem 0.875rem;
    color: #212529;
    vertical-align: middle;
}

.ris-no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
    font-style: italic;
}

/* ── Pagination ──────────────────────────────────── */
.ris-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    margin-top: 0.5rem;
    border-radius: 0 0 4px 4px;
}

.ris-page-info {
    font-size: 0.82rem;
    color: #6c757d;
}

.ris-page-size {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #6c757d;
}

    .ris-page-size select {
        border: 1px solid #ced4da;
        border-radius: 4px;
        padding: 0.15rem 0.35rem;
        font-size: 0.82rem;
        color: #212529;
    }

.ris-page-controls {
    display: flex;
    gap: 0.2rem;
}

.ris-page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 0.4rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #495057;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.1s;
}

    .ris-page-btn:hover:not(:disabled) {
        background: #e9ecef;
    }

    .ris-page-btn:disabled {
        opacity: 0.4;
        cursor: default;
    }

.ris-page-active {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
    font-weight: 600;
}

.ris-page-ellipsis {
    padding: 0 0.2rem;
    color: #adb5bd;
    line-height: 30px;
}

/* ── Import form ─────────────────────────────────── */
.ris-form-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.ris-form-label {
    font-size: 0.875rem;
    color: #212529;
    white-space: nowrap;
}

.ris-delimiter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.import-custom-alert {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    display: inline-block;
}

.ris-tooltip-wrapper {
    position: relative;
    cursor: default;
}

.ris-tooltip-text {
    visibility: hidden;
    opacity: 0;
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.4;
    width: 280px;
    white-space: normal;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.2s;
    z-index: 10;
    pointer-events: none;
}

.ris-tooltip-wrapper:hover .ris-tooltip-text {
    visibility: visible;
    opacity: 1;
}
