/* Page wrapper */
.repo-stats-page {
    background: #f8f9fa;
    padding: 40px 0 0;
    min-height: 60vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rs-container {
    max-width: 1124px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Title row ─────────────────────────────────── */
.rs-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 14px;
}

.rs-title {
    font-size: 28px;
    font-weight: 600;
    color: #000;
    margin: 0;
    line-height: 1.3;
}

.rs-title-links {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
    padding-top: 6px;
}

.rs-title-links a {
    color: #1e73da;
    font-size: 17px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.rs-title-links a:hover {
    color: #1e73da;
    opacity: 0.85;
}

/* ── Description ───────────────────────────────── */
.rs-description {
    color: #1f2937;
    font-size: 18px;
    line-height: 1.5;
    margin: 0 0 32px;
    max-width: 1014px;
}

/* ── Stat cards ────────────────────────────────── */
.rs-stat-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}

.rs-stat-card {
    background: #fff;
    border: 1px solid #d9dade;
    border-radius: 16px;
    padding: 22px;
    min-height: 171px;
    display: flex;
    flex-direction: column;
}

.rs-stat-icon {
    margin-bottom: 26px;
    color: #6b7280;
}

.rs-stat-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.6;
}

.rs-stat-number {
    font-size: 32px;
    font-weight: 600;
    color: #0a0a0a;
    line-height: 1;
}

.rs-stat-label {
    font-size: 15px;
    color: #0a0a0a;
    margin-top: 10px;
}

.rs-stat-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.rs-stat-label-row .rs-stat-label {
    margin-top: 0;
}

.rs-stat-pct {
    font-size: 24px;
    color: #0a0a0a;
    font-weight: 600;
    line-height: 1;
}

/* ── Tab navigation ────────────────────────────── */
.rs-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.rs-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    border-radius: 90px;
    border: 1px solid #1e73da;
    background: #e9f2fe;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.rs-tab:hover {
    background: #d6e7fd;
    color: #000;
}

.rs-tab.rs-tab-active,
.rs-tab.rs-tab-active:hover {
    background: #1e73da;
    border-color: #1e73da;
    color: #fff;
}

/* ── Section panel ─────────────────────────────── */
.rs-section {
    margin-bottom: 32px;
}

.rs-panel {
    background: #fff;
    border: 1px solid #d9dade;
    border-radius: 16px;
    padding: 28px;
}

.rs-panel-title {
    font-size: 21px;
    font-weight: 600;
    color: #000;
    margin: 0 0 12px;
}

.rs-panel-text {
    font-size: 16px;
    color: #000;
    line-height: 1.5;
    margin: 0 0 20px;
}

/* ── Verification Progress chart ───────────────── */
.rs-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.rs-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    font-size: 12px;
    color: #000;
    align-items: center;
}

.rs-chart-legend .swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 2px;
    margin-right: 5px;
    vertical-align: -2px;
}

.swatch-gray        { background: #d9dade; }
.swatch-blue        { background: #6aa9f5; }
.swatch-green       { background: #6ad845; }
.swatch-green-light { background: #a9e894; }
.swatch-dark        { background: #fff; border: 1px solid #000; }

#verification-chart {
    width: 100%;
    height: 420px;
    display: block;
}

/* ── Contribute panel ──────────────────────────── */
.rs-contribute-panel {
    display: flex;
    align-items: center;
    gap: 32px;
}

.rs-contribute-body {
    flex: 1;
    min-width: 0;
}

.rs-contribute-body .rs-panel-text {
    margin-bottom: 0;
}

/* ── Contribute CTA ────────────────────────────── */
.rs-btn-primary {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    background: #45ce16;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.rs-btn-primary:hover {
    background: #3fbb14;
    color: #fff;
}

/* ── Function Status: summary ──────────────────── */
.rs-fn-summary {
    display: flex;
    gap: 32px;
    font-size: 16px;
    color: #000;
    margin-bottom: 16px;
    flex-wrap: wrap;
    border: 1px solid #d9dade;
    border-radius: 8px;
    padding: 22px 24px;
    background: #fafafa;
}

.rs-fn-summary strong {
    font-weight: 700;
    color: #000;
}

/* ── Function Status: filters ──────────────────── */
.rs-fn-filters {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.rs-fn-filter-input {
    flex: 1;
    min-width: 200px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9dade;
    border-radius: 4px;
    font-size: 15px;
    outline: none;
    color: #000;
    background: #fff;
    font-family: inherit;
}

.rs-fn-filter-input::placeholder {
    color: #838486;
}

.rs-fn-filter-input:focus {
    border-color: #1e73da;
    box-shadow: 0 0 0 2px rgba(30,115,218,.12);
}

.rs-fn-filter-select {
    width: 215px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9dade;
    border-radius: 4px;
    font-size: 15px;
    background: #fff;
    outline: none;
    cursor: pointer;
    color: #000;
    font-family: inherit;
}

.rs-fn-filter-select:focus {
    border-color: #1e73da;
}

/* ── Function Status: column toggles ───────────── */
.rs-fn-columns {
    display: flex;
    gap: 28px;
    font-size: 16px;
    color: #000;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid #d9dade;
    border-radius: 8px;
    padding: 22px 24px;
    background: #fafafa;
}

.rs-fn-columns-label {
    font-weight: 400;
    color: #000;
    margin-right: 2px;
}

.rs-fn-columns label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
    color: #000;
}

/* Custom checkbox: overrides Materialize, which otherwise hides the native
   control (position:absolute; opacity:0) and never draws a replacement. */
.rs-fn-columns input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    position: static;
    opacity: 1;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    padding: 0;
    border: 1px solid #a9aaad;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
}

.rs-fn-columns input[type="checkbox"]:checked {
    background: #1e73da;
    border-color: #1e73da;
}

.rs-fn-columns input[type="checkbox"]:checked::after {
    content: "";
    display: block;
    width: 5px;
    height: 9px;
    margin: 1px auto 0;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.rs-fn-columns input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(30,115,218,.4);
    outline-offset: 1px;
}

/* ── Function Status: pagination row ───────────── */
.rs-fn-pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 16px;
    color: #000;
}

.rs-fn-per-page {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rs-fn-per-page select {
    width: 216px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9dade;
    border-radius: 4px;
    font-size: 15px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
    color: #000;
}

/* ── Function Status: table ────────────────────── */
.rs-fn-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rs-fn-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.rs-fn-table thead th {
    background: #3fbb14;
    color: #fff;
    height: 56px;
    padding: 0 18px;
    text-align: left;
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    border-radius: 0; /* override Materialize's td,th { border-radius: 2px } */
}

.rs-fn-table tbody td {
    height: 56px;
    padding: 0 18px;
    border-bottom: 1px solid #d9dade;
    color: #000;
    vertical-align: middle;
    border-radius: 0;
}

.rs-fn-table tbody tr:nth-child(even) td {
    background: #fafafc;
}

.rs-fn-table tbody tr:hover td {
    background: #f1f3f6;
}

/* Constrain the Function (name) column so long identifiers don't blow out the layout */
.rs-fn-table thead th:first-child,
.rs-fn-table .rs-fn-name-cell {
    max-width: 480px;
}

.rs-fn-table .rs-fn-name {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.rs-fn-table .fn-check {
    color: #45ce16;
    font-weight: 700;
}

.rs-fn-table .fn-dash {
    color: #838486;
}

.rs-fn-th-sort {
    cursor: pointer;
    user-select: none;
}

.rs-fn-th-sort:hover {
    opacity: 0.9;
}

/* ── View on GitHub button in table ────────────── */
.rs-fn-github-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border: 1px solid #a9aaad;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #000;
    text-decoration: none;
    background: #f4f5f8;
    white-space: nowrap;
    transition: background 0.12s;
}

.rs-fn-github-btn:hover {
    background: #eef0f4;
}

.rs-fn-github-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Bottom pagination ─────────────────────────── */
.rs-fn-pagination {
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    margin-top: 20px;
}

.rs-fn-page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d9dade;
    border-radius: 4px;
    font-size: 15px;
    color: #000;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    font-family: inherit;
}

.rs-fn-page-btn:hover {
    border-color: #1e73da;
    color: #1e73da;
}

.rs-fn-page-btn.active,
.rs-fn-page-btn.active:hover {
    background: #3fbb14;
    border-color: #3fbb14;
    color: #fff;
}

.rs-fn-page-btn:disabled {
    opacity: .4;
    cursor: default;
    pointer-events: none;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
    .rs-title-row {
        flex-direction: column;
        gap: 8px;
    }

    .rs-title {
        font-size: 22px;
    }

    .rs-description {
        font-size: 16px;
    }

    .rs-stat-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .rs-tabs {
        gap: 8px;
    }

    .rs-tab {
        height: 42px;
        padding: 0 18px;
        font-size: 14px;
    }

    .rs-panel {
        padding: 20px 16px;
    }

    .rs-contribute-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .rs-contribute-body .rs-panel-text {
        margin-bottom: 16px;
    }

    .rs-fn-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .rs-fn-filter-input,
    .rs-fn-filter-select {
        min-width: 0;
        width: 100%;
    }

    .rs-fn-pagination-row {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .rs-fn-per-page select {
        width: 100%;
    }

    #verification-chart {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .repo-stats-page {
        padding: 24px 0 0;
    }

    .rs-stat-number {
        font-size: 30px;
    }
}
