/* SK Officials — shared mobile/desktop table + page fit */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.main-content,
.page-container,
.schol-page-container,
.saf-page-wrap,
.dashboard-container,
.profile-container,
.calendar-page-container {
    min-width: 0;
    max-width: 100%;
}

.table-wrapper,
.saf-table-wrap,
.schol-table-wrap,
.sports-table-wrap,
.spl-table-wrapper,
.sl-table-wrapper,
.rm-records-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.table-wrapper::-webkit-scrollbar,
.saf-table-wrap::-webkit-scrollbar,
.schol-table-wrap::-webkit-scrollbar,
.sports-table-wrap::-webkit-scrollbar,
.spl-table-wrapper::-webkit-scrollbar,
.sl-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-thumb,
.saf-table-wrap::-webkit-scrollbar-thumb,
.schol-table-wrap::-webkit-scrollbar-thumb,
.sports-table-wrap::-webkit-scrollbar-thumb,
.spl-table-wrapper::-webkit-scrollbar-thumb,
.sl-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(44, 44, 62, 0.35);
    border-radius: 8px;
}

@media (max-width: 1024px) {
    .main-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .page-header-section,
    .page-header-modern-with-button,
    .page-header-right,
    .page-header-actions,
    .filters-row,
    .table-action-bar,
    .dash-page-header,
    .dash-page-filters {
        flex-wrap: wrap;
        max-width: 100%;
        min-width: 0;
    }

    .filter-input,
    .filter-select,
    .filter-dropdown,
    .abyip-filter-search-inline,
    .search-input {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Keep filter rows on-screen (no drag-scroll). Two columns so labels stay readable. */
    .filters-row,
    .schol-filters-row,
    .abyip-filters-row,
    .saf-sports-filters,
    .saf-schedule-filters,
    .dash-chart-header-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden !important;
        flex-wrap: unset;
    }

    .rejected-filters-oneline,
    .rejected-kk-page .rejected-filters-oneline,
    .rejected-schol-page .rejected-filters-oneline,
    .archive-filters-oneline {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        overflow: visible !important;
        align-items: stretch !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 8px !important;
    }

    .line-chart-select-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
        min-width: 0;
    }

    .dash-chart-header-actions .line-chart-select-group {
        width: auto;
        min-width: 0;
    }

    .filter-item,
    .filter-item-email {
        flex: none !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .filter-label,
    .dash-filter-label,
    .show-archive-label,
    .skkp-year-filter-label {
        font-size: 11px !important;
        letter-spacing: 0.02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 4px !important;
    }

    /* Closed select + native option list (Chrome/iOS picker). */
    select,
    select.filter-select,
    select.schol-filter-input,
    select.schol-input,
    select.dash-filter-select,
    select.abyip-filter-select,
    select.pagination-rows-select,
    select.show-archive-select,
    select.compose-type-select,
    select.sl-filter-select,
    select.eval-filter-select {
        font-size: 13px !important;
        line-height: 1.3 !important;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
        min-width: 0 !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    select option,
    .filter-select option,
    .schol-filter-input option,
    .dash-filter-select option,
    .abyip-filter-select option,
    .show-archive-select option,
    .pagination-rows-select option {
        font-size: 13px !important;
        line-height: 1.35 !important;
        font-weight: 400 !important;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
        padding: 4px 8px;
    }

    .filter-select,
    .schol-filter-input,
    .dash-filter-select,
    .abyip-filter-select,
    .show-archive-select {
        height: 36px;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    .filter-input,
    .search-input,
    .abyip-filter-search-inline {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }

    .show-archive-wrap {
        min-width: 0;
        max-width: 100%;
    }

    .module-stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        overflow-x: visible !important;
        width: 100%;
    }

    .module-stats-grid .stat-card {
        min-width: 0 !important;
        width: auto;
        flex: none;
    }

    .table-wrapper table,
    .saf-table-wrap table,
    .schol-table-wrap table,
    .sports-table-wrap table,
    .spl-table-wrapper table,
    .sl-table-wrapper table {
        min-width: 680px;
    }

    .table-page-footer,
    .audit-page-footer,
    .pagination-footer {
        left: 0 !important;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .page-title,
    .page-title-modern,
    .dash-page-title {
        font-size: 1.35rem;
        word-break: break-word;
    }

    .page-subtitle,
    .page-subtitle-modern,
    .dash-page-sub {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    select,
    select option,
    .filter-select option,
    .dash-filter-select option {
        font-size: 12px !important;
    }

    .filter-label,
    .dash-filter-label {
        font-size: 10px !important;
    }
}

/* Compact one-line archive / rejected filters (desktop + mobile) */
.archive-filters-oneline,
.rejected-filters-oneline {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 14px;
    box-sizing: border-box;
}

.archive-filters-oneline > select,
.archive-filters-oneline > .filter-input,
.archive-filters-oneline > .schol-filter-input,
.archive-filters-oneline > .dso-year-filter,
.archive-filters-oneline > .dso-filter-select,
.archive-filters-oneline > .dso-search-input,
.archive-filters-oneline > .archive-filter-select,
.rejected-filters-oneline > select,
.rejected-filters-oneline > .filter-input,
.rejected-filters-oneline > .schol-filter-input {
    flex: 0 1 auto;
    height: 38px;
    min-height: 38px;
    min-width: 0;
    width: auto;
    max-width: none;
    padding: 0 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 9px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    box-sizing: border-box;
}

.archive-search-wrap,
.archive-filters-oneline .schol-search-wrap,
.rejected-filters-oneline .schol-search-wrap {
    position: relative;
    flex: 1 1 160px;
    min-width: 140px;
    max-width: none;
}

.archive-filter-pair {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
}

.archive-filter-pair > select,
.archive-filter-pair > .filter-input {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 38px;
    min-height: 38px;
    padding: 0 32px 0 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 9px;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    font-size: 13px;
    box-sizing: border-box;
}

.archive-search-wrap svg,
.archive-filters-oneline .schol-search-wrap svg,
.rejected-filters-oneline .schol-search-wrap svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.archive-search-wrap input,
.archive-filters-oneline .schol-search-input,
.rejected-filters-oneline .schol-search-input {
    width: 100%;
    height: 38px;
    min-height: 38px;
    min-width: 0;
    max-width: 100%;
    padding: 0 12px 0 32px;
    border: 1.5px solid #d1d5db;
    border-radius: 9px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    box-sizing: border-box;
}

.archive-filters-oneline .filter-tabs-group,
.archive-filters-oneline .dso-filter-tabs,
.rejected-filters-oneline .filter-tabs-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
}

.archive-filters-oneline .filter-tab,
.archive-filters-oneline .dso-tab,
.rejected-filters-oneline .filter-tab {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.archive-filters-oneline .filter-tab.active,
.archive-filters-oneline .dso-tab.active,
.rejected-filters-oneline .filter-tab.active {
    background: #0039A8;
    color: #fff;
    border-color: #0039A8;
}

.archive-filters-oneline .dso-clear-filters {
    height: 38px;
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .archive-filters-oneline,
    .rejected-filters-oneline,
    .rejected-kk-page .rejected-filters-oneline,
    .rejected-kk-page .archive-filters-oneline,
    .rejected-schol-page .rejected-filters-oneline,
    .rejected-schol-page .archive-filters-oneline {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        grid-template-columns: none !important;
        overflow: visible !important;
        gap: 8px !important;
        padding-bottom: 0;
    }

    .archive-filters-oneline > select,
    .archive-filters-oneline > .filter-input,
    .archive-filters-oneline > .schol-filter-input,
    .archive-filters-oneline > .dso-year-filter,
    .archive-filters-oneline > .dso-filter-select,
    .archive-filters-oneline > .archive-filter-select,
    .archive-search-wrap,
    .rejected-filters-oneline > select,
    .rejected-filters-oneline > .filter-input,
    .rejected-filters-oneline > .schol-filter-input,
    .rejected-filters-oneline .schol-search-wrap,
    .archive-filters-oneline .schol-search-wrap {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .archive-filters-oneline > select,
    .rejected-filters-oneline > select,
    .archive-filters-oneline > .schol-filter-input,
    .rejected-filters-oneline > .schol-filter-input {
        height: 40px;
        min-height: 40px;
        padding: 0 32px 0 12px !important;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 16px;
        appearance: none;
        -webkit-appearance: none;
    }

    .archive-search-wrap input,
    .archive-filters-oneline .schol-search-input,
    .rejected-filters-oneline .schol-search-input,
    .archive-filters-oneline .filter-input,
    .archive-filters-oneline .dso-search-input {
        height: 40px;
        min-height: 40px;
        font-size: 13px;
    }

    .archive-filters-oneline .filter-tabs-group,
    .archive-filters-oneline .dso-filter-tabs,
    .rejected-filters-oneline .filter-tabs-group {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 6px !important;
    }

    .archive-filters-oneline .filter-tab,
    .archive-filters-oneline .dso-tab,
    .rejected-filters-oneline .filter-tab {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
        height: auto;
        min-height: 36px;
        padding: 8px 10px;
        font-size: 12px;
        text-align: center;
    }

    .archive-filters-oneline .dso-clear-filters {
        width: 100%;
        height: 40px;
    }

    .archive-filter-pair {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
    }

    .archive-filter-pair > select,
    .archive-filter-pair > .filter-input,
    .rejected-schol-page .archive-filters-oneline select.filter-input {
        height: 40px;
        min-height: 40px;
        padding: 0 32px 0 12px !important;
        background-color: #fff;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 16px;
        appearance: none;
        -webkit-appearance: none;
    }
}
