/* ==============================
   MAIN CONTAINER
   ============================== */
#library_repository_stats_dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding: 20px;
    background: #f5f7fa;
    border-radius: 12px;
    max-width: 100%;
    overflow-x: hidden;
}

/* ==============================
   LOADING ANIMATION (SKELETON)
   ============================== */
#library_repository_stats_dashboard .loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

#library_repository_stats_dashboard .skeleton-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

#library_repository_stats_dashboard .skeleton-cell {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Скелетон для таблицы */
#library_repository_stats_dashboard .table-skeleton {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

#library_repository_stats_dashboard .table-skeleton .skeleton-row {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
}

#library_repository_stats_dashboard .table-skeleton .skeleton-row:first-child {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#library_repository_stats_dashboard .table-skeleton .skeleton-cell:first-child {
    width: 50px;
}

#library_repository_stats_dashboard .table-skeleton .skeleton-cell:nth-child(2) {
    width: 200px;
}

#library_repository_stats_dashboard .table-skeleton .skeleton-cell:nth-child(3) {
    width: 180px;
}

#library_repository_stats_dashboard .table-skeleton .skeleton-cell:nth-child(4) {
    width: 100px;
}

#library_repository_stats_dashboard .table-skeleton .skeleton-cell:nth-child(5) {
    width: 110px;
}

#library_repository_stats_dashboard .table-skeleton .skeleton-cell:nth-child(6) {
    width: 80px;
}

/* Скелетон для карточек */
#library_repository_stats_dashboard .card-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

#library_repository_stats_dashboard .card-skeleton .skeleton-cell {
    height: 60px;
}

#library_repository_stats_dashboard .card-skeleton .skeleton-cell:first-child {
    height: 30px;
    width: 60%;
    margin: 0 auto;
}

/* Скелетон для графика */
#library_repository_stats_dashboard .chart-skeleton {
    height: 280px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 12px;
    margin: 12px;
}

/* Скелетон для таблицы пользователей */
#library_repository_stats_dashboard .users-rating-skeleton {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

#library_repository_stats_dashboard .users-rating-skeleton .skeleton-row {
    display: flex;
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

#library_repository_stats_dashboard .users-rating-skeleton .skeleton-row.header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#library_repository_stats_dashboard .users-rating-skeleton .skeleton-cell {
    height: 18px;
}

#library_repository_stats_dashboard .users-rating-skeleton .skeleton-cell:nth-child(1) { width: 40px; }
#library_repository_stats_dashboard .users-rating-skeleton .skeleton-cell:nth-child(2) { width: 180px; }
#library_repository_stats_dashboard .users-rating-skeleton .skeleton-cell:nth-child(3) { width: 160px; }
#library_repository_stats_dashboard .users-rating-skeleton .skeleton-cell:nth-child(4) { width: 90px; }
#library_repository_stats_dashboard .users-rating-skeleton .skeleton-cell:nth-child(5) { width: 100px; }
#library_repository_stats_dashboard .users-rating-skeleton .skeleton-cell:nth-child(6) { width: 70px; }

/* ==============================
   TABS
   ============================== */
#library_repository_stats_dashboard .tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
    background: transparent;
    flex-wrap: wrap;
}

#library_repository_stats_dashboard .tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    color: #7f8c8d;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
}

#library_repository_stats_dashboard .tab-btn:hover {
    background: #f5f5f5;
    color: #2c3e50;
}

#library_repository_stats_dashboard .tab-btn.active {
    color: #3498db;
    border-bottom: 3px solid #3498db;
    background: #f8f9fa;
}

#library_repository_stats_dashboard .tab-content {
    display: none;
}

#library_repository_stats_dashboard .tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ==============================
   CARDS
   ============================== */
#library_repository_stats_dashboard .repo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

#library_repository_stats_dashboard .repo-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 12px 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    cursor: help;
}

#library_repository_stats_dashboard .repo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#library_repository_stats_dashboard .repo-card:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 5px;
}

#library_repository_stats_dashboard .repo-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 6px;
}

#library_repository_stats_dashboard .repo-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.2;
}

#library_repository_stats_dashboard .repo-sub {
    font-size: 10px;
    color: #95a5a6;
    margin-top: 5px;
}

/* ==============================
   SECTION TITLES
   ============================== */
#library_repository_stats_dashboard .section-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 20px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #3498db;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#library_repository_stats_dashboard .section-desc {
    font-size: 11px;
    font-weight: normal;
    color: #7f8c8d;
    margin-left: 0;
}

/* ==============================
   CHARTS - 2x2 сетка
   ============================== */
#library_repository_stats_dashboard .charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    #library_repository_stats_dashboard .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

#library_repository_stats_dashboard .chart-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

#library_repository_stats_dashboard .chart-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#library_repository_stats_dashboard .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 0 15px;
    flex-wrap: wrap;
    gap: 8px;
}

#library_repository_stats_dashboard .chart-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

#library_repository_stats_dashboard .chart-desc {
    font-size: 10px;
    color: #95a5a6;
    text-align: center;
    margin: 8px 15px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ecf0f1;
}

#library_repository_stats_dashboard .chart-container {
    padding: 12px;
    flex: 1;
    min-height: 280px;
}

/* ==============================
   TOGGLE BUTTONS
   ============================== */
#library_repository_stats_dashboard .chart-toggle {
    display: flex;
    gap: 5px;
}

#library_repository_stats_dashboard .toggle-btn {
    padding: 4px 10px;
    background: #ecf0f1;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

#library_repository_stats_dashboard .toggle-btn:hover {
    background: #bdc3c7;
}

#library_repository_stats_dashboard .toggle-btn.active {
    background: #3498db;
    color: white;
}

/* ==============================
   TABLES - 1x2 сетка
   ============================== */
#library_repository_stats_dashboard .tables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    #library_repository_stats_dashboard .tables-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

#library_repository_stats_dashboard .table-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#library_repository_stats_dashboard .table-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#library_repository_stats_dashboard .table-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

#library_repository_stats_dashboard .table-desc {
    font-size: 10px;
    color: #95a5a6;
    margin-top: 4px;
}

/* ==============================
   PERIOD FILTER
   ============================== */
#library_repository_stats_dashboard .period-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#library_repository_stats_dashboard .period-btn {
    padding: 6px 14px;
    background: #ecf0f1;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

#library_repository_stats_dashboard .period-btn:hover {
    background: #bdc3c7;
}

#library_repository_stats_dashboard .period-btn.active {
    background: #3498db;
    color: white;
}

/* ==============================
   TABLES STYLES
   ============================== */
#library_repository_stats_dashboard .table-container {
    background: white;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

#library_repository_stats_dashboard .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

#library_repository_stats_dashboard .data-table th {
    padding: 10px 12px;
    text-align: left;
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
    position: sticky;
    top: 0;
}

#library_repository_stats_dashboard .data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ecf0f1;
}

#library_repository_stats_dashboard .data-table tr:hover {
    background: #f8f9fa;
}

#library_repository_stats_dashboard .title-cell,
#library_repository_stats_dashboard .author-cell,
#library_repository_stats_dashboard .user-name-cell,
#library_repository_stats_dashboard .user-email-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==============================
   USERS RATING TABLE
   ============================== */
#library_repository_stats_dashboard .users-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    margin-top: 20px;
}

#library_repository_stats_dashboard .users-rating-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 700px;
}

#library_repository_stats_dashboard .users-rating-table th {
    padding: 12px 12px;
    text-align: left;
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
}

#library_repository_stats_dashboard .users-rating-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
}

#library_repository_stats_dashboard .users-rating-table tr:hover {
    background: #f8f9fa;
}

#library_repository_stats_dashboard .rank {
    font-weight: bold;
    color: #3498db;
    width: 45px;
    font-size: 12px;
}

#library_repository_stats_dashboard .user-name {
    font-weight: 500;
    color: #2c3e50;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#library_repository_stats_dashboard .user-email {
    font-family: monospace;
    font-size: 11px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#library_repository_stats_dashboard .user-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
}

#library_repository_stats_dashboard .status-active {
    background: #d4edda;
    color: #155724;
}

#library_repository_stats_dashboard .status-moderate {
    background: #fff3cd;
    color: #856404;
}

#library_repository_stats_dashboard .status-inactive {
    background: #f8d7da;
    color: #721c24;
}

#library_repository_stats_dashboard .status-never {
    background: #e2e3e5;
    color: #383d41;
}

#library_repository_stats_dashboard .user-items {
    text-align: center;
    font-size: 12px;
}

#library_repository_stats_dashboard .user-actions {
    text-align: center;
}

#library_repository_stats_dashboard .btn-details {
    padding: 4px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.3s;
}

#library_repository_stats_dashboard .btn-details:hover {
    background: #2980b9;
}

/* ==============================
   ANALYTICS GRID (3 колонки)
   ============================== */
#library_repository_stats_dashboard .analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 1000px) {
    #library_repository_stats_dashboard .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #library_repository_stats_dashboard .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   MODAL
   ============================== */
#library_repository_stats_dashboard .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

#library_repository_stats_dashboard .modal-content {
    background-color: white;
    margin: 50px auto;
    width: 90%;
    max-width: 850px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideIn 0.3s;
}

#library_repository_stats_dashboard .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#library_repository_stats_dashboard .modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

#library_repository_stats_dashboard .modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

#library_repository_stats_dashboard .modal-close:hover {
    color: #333;
}

#library_repository_stats_dashboard .modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
    background: #f8f9fa;
}

#library_repository_stats_dashboard .modal-tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #7f8c8d;
    transition: all 0.3s;
}

#library_repository_stats_dashboard .modal-tab-btn:hover {
    color: #3498db;
}

#library_repository_stats_dashboard .modal-tab-btn.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

#library_repository_stats_dashboard .modal-body {
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
}

#library_repository_stats_dashboard .modal-tab-content {
    display: none;
}

#library_repository_stats_dashboard .modal-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* ==============================
   USER STATS DETAILS
   ============================== */
#library_repository_stats_dashboard .user-stats-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

#library_repository_stats_dashboard .detail-row {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

#library_repository_stats_dashboard .detail-row strong {
    color: #2c3e50;
    min-width: 150px;
    display: inline-block;
}

#library_repository_stats_dashboard .detail-divider {
    grid-column: span 2;
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

/* ==============================
   CONTRIBUTIONS TABLE
   ============================== */
#library_repository_stats_dashboard .contributions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#library_repository_stats_dashboard .contributions-table th {
    padding: 12px 10px;
    text-align: left;
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
}

#library_repository_stats_dashboard .contributions-table td {
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
}

/* ==============================
   LOADING, NO DATA, ERROR
   ============================== */
#library_repository_stats_dashboard .loading,
#library_repository_stats_dashboard .no-data,
#library_repository_stats_dashboard .error {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 14px;
}

#library_repository_stats_dashboard .error {
    color: #e74c3c;
}

/* ==============================
   ANIMATIONS
   ============================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    #library_repository_stats_dashboard {
        padding: 12px;
    }
    
    #library_repository_stats_dashboard .repo-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    #library_repository_stats_dashboard .repo-card {
        padding: 10px 12px;
    }
    
    #library_repository_stats_dashboard .repo-value {
        font-size: 20px;
    }
    
    #library_repository_stats_dashboard .repo-title {
        font-size: 10px;
    }
    
    #library_repository_stats_dashboard .section-title {
        font-size: 16px;
        margin: 15px 0 10px 0;
    }
    
    #library_repository_stats_dashboard .section-desc {
        font-size: 10px;
    }
    
    #library_repository_stats_dashboard .chart-container {
        min-height: 240px;
        padding: 10px;
    }
    
    #library_repository_stats_dashboard .chart-header h3 {
        font-size: 13px;
    }
    
    #library_repository_stats_dashboard .data-table,
    #library_repository_stats_dashboard .users-rating-table {
        font-size: 11px;
    }
    
    #library_repository_stats_dashboard .data-table th,
    #library_repository_stats_dashboard .data-table td,
    #library_repository_stats_dashboard .users-rating-table th,
    #library_repository_stats_dashboard .users-rating-table td {
        padding: 8px 10px;
    }
    
    #library_repository_stats_dashboard .title-cell,
    #library_repository_stats_dashboard .author-cell,
    #library_repository_stats_dashboard .user-name,
    #library_repository_stats_dashboard .user-email {
        max-width: 130px;
    }
    
    #library_repository_stats_dashboard .rank {
        width: 35px;
    }
    
    #library_repository_stats_dashboard .btn-details {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    #library_repository_stats_dashboard .modal-content {
        margin: 20px auto;
        width: 95%;
    }
    
    #library_repository_stats_dashboard .modal-header {
        padding: 15px 20px;
    }
    
    #library_repository_stats_dashboard .modal-header h2 {
        font-size: 18px;
    }
    
    #library_repository_stats_dashboard .modal-tabs {
        padding: 0 16px;
    }
    
    #library_repository_stats_dashboard .modal-tab-btn {
        padding: 10px 14px;
        font-size: 12px;
    }
    
    #library_repository_stats_dashboard .modal-body {
        padding: 16px;
    }
    
    #library_repository_stats_dashboard .user-stats-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    #library_repository_stats_dashboard .detail-divider {
        grid-column: span 1;
    }
    
    #library_repository_stats_dashboard .detail-row strong {
        min-width: 120px;
    }
    
    #library_repository_stats_dashboard .contributions-table {
        font-size: 11px;
    }
    
    #library_repository_stats_dashboard .contributions-table th,
    #library_repository_stats_dashboard .contributions-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    #library_repository_stats_dashboard .repo-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    #library_repository_stats_dashboard .repo-card {
        padding: 8px 10px;
    }
    
    #library_repository_stats_dashboard .repo-value {
        font-size: 18px;
    }
    
    #library_repository_stats_dashboard .repo-title {
        font-size: 9px;
    }
    
    #library_repository_stats_dashboard .tab-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    #library_repository_stats_dashboard .period-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    #library_repository_stats_dashboard .toggle-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    #library_repository_stats_dashboard .title-cell,
    #library_repository_stats_dashboard .author-cell,
    #library_repository_stats_dashboard .user-name,
    #library_repository_stats_dashboard .user-email {
        max-width: 100px;
    }
}

/* ==============================
   PRINT STYLES
   ============================== */
@media print {
    #library_repository_stats_dashboard .tab-btn,
    #library_repository_stats_dashboard .period-filter,
    #library_repository_stats_dashboard .btn-details,
    #library_repository_stats_dashboard .modal-close,
    #library_repository_stats_dashboard .modal-tabs,
    #library_repository_stats_dashboard .chart-toggle {
        display: none !important;
    }
    
    #library_repository_stats_dashboard .tab-content {
        display: block !important;
    }
    
    #library_repository_stats_dashboard .repo-card,
    #library_repository_stats_dashboard .chart-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    #library_repository_stats_dashboard .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #library_repository_stats_dashboard .tables-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #library_repository_stats_dashboard .modal {
        display: none !important;
    }
}

/* ==============================
   SCROLLBAR STYLES
   ============================== */
#library_repository_stats_dashboard .table-container::-webkit-scrollbar,
#library_repository_stats_dashboard .users-table-container::-webkit-scrollbar,
#library_repository_stats_dashboard .modal-body::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

#library_repository_stats_dashboard .table-container::-webkit-scrollbar-track,
#library_repository_stats_dashboard .users-table-container::-webkit-scrollbar-track,
#library_repository_stats_dashboard .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#library_repository_stats_dashboard .table-container::-webkit-scrollbar-thumb,
#library_repository_stats_dashboard .users-table-container::-webkit-scrollbar-thumb,
#library_repository_stats_dashboard .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#library_repository_stats_dashboard .table-container::-webkit-scrollbar-thumb:hover,
#library_repository_stats_dashboard .users-table-container::-webkit-scrollbar-thumb:hover,
#library_repository_stats_dashboard .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==============================
   SKELETON LOADING ANIMATION
   ============================== */
#library_repository_stats_dashboard .skeleton-row {
    animation: skeleton-pulse 1.2s ease-in-out infinite;
}

#library_repository_stats_dashboard .skeleton-cell {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#library_repository_stats_dashboard .users-rating-table .skeleton-row:hover {
    background: transparent;
}

/* Spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#library_repository_stats_dashboard .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#library_repository_stats_dashboard .loading-spinner {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

#library_repository_stats_dashboard .loading-spinner .spinner {
    margin-bottom: 10px;
}

/* ==============================
   MODAL WINDOW STYLES
   ============================== */
#library_repository_stats_dashboard .modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(3px);
    }
}

#library_repository_stats_dashboard .modal-content {
    background-color: #ffffff;
    margin: 50px auto;
    width: 90%;
    max-width: 850px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#library_repository_stats_dashboard .modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#library_repository_stats_dashboard .modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

#library_repository_stats_dashboard .modal-close {
    font-size: 28px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
    line-height: 1;
}

#library_repository_stats_dashboard .modal-close:hover {
    color: white;
    transform: scale(1.1);
}

#library_repository_stats_dashboard .modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    background: #f8f9fa;
}

#library_repository_stats_dashboard .modal-tab-btn {
    padding: 14px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.3s;
    position: relative;
}

#library_repository_stats_dashboard .modal-tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

#library_repository_stats_dashboard .modal-tab-btn.active {
    color: #667eea;
}

#library_repository_stats_dashboard .modal-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

#library_repository_stats_dashboard .modal-body {
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
    background: #ffffff;
}

/* Scrollbar for modal body */
#library_repository_stats_dashboard .modal-body::-webkit-scrollbar {
    width: 6px;
}

#library_repository_stats_dashboard .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#library_repository_stats_dashboard .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#library_repository_stats_dashboard .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#library_repository_stats_dashboard .modal-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

#library_repository_stats_dashboard .modal-tab-content.active {
    display: block;
}

/* User stats details inside modal */
#library_repository_stats_dashboard .user-stats-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

#library_repository_stats_dashboard .detail-row {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
}

#library_repository_stats_dashboard .detail-row strong {
    color: #2c3e50;
    min-width: 150px;
    display: inline-block;
    font-weight: 600;
}

#library_repository_stats_dashboard .detail-divider {
    grid-column: span 2;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
    margin: 12px 0;
}

/* Contributions table inside modal */
#library_repository_stats_dashboard .contributions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#library_repository_stats_dashboard .contributions-table th {
    padding: 12px 10px;
    text-align: left;
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
}

#library_repository_stats_dashboard .contributions-table td {
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
}

#library_repository_stats_dashboard .contributions-table tr:hover {
    background: #f8f9fa;
}

#library_repository_stats_dashboard .contributions-table .title-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Activity chart container */
#library_repository_stats_dashboard .modal-activity-chart-container {
    padding: 15px;
    min-height: 300px;
}

/* Responsive modal */
@media (max-width: 768px) {
    #library_repository_stats_dashboard .modal-content {
        margin: 20px auto;
        width: 95%;
        border-radius: 16px;
    }
    
    #library_repository_stats_dashboard .modal-header {
        padding: 15px 20px;
    }
    
    #library_repository_stats_dashboard .modal-header h2 {
        font-size: 18px;
    }
    
    #library_repository_stats_dashboard .modal-tabs {
        padding: 0;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    #library_repository_stats_dashboard .modal-tab-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    #library_repository_stats_dashboard .modal-body {
        padding: 16px;
        max-height: 450px;
    }
    
    #library_repository_stats_dashboard .user-stats-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    #library_repository_stats_dashboard .detail-divider {
        grid-column: span 1;
    }
    
    #library_repository_stats_dashboard .detail-row strong {
        min-width: 120px;
    }
    
    #library_repository_stats_dashboard .contributions-table {
        font-size: 11px;
    }
    
    #library_repository_stats_dashboard .contributions-table th,
    #library_repository_stats_dashboard .contributions-table td {
        padding: 8px 6px;
    }
    
    #library_repository_stats_dashboard .contributions-table .title-cell {
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    #library_repository_stats_dashboard .modal-tab-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    #library_repository_stats_dashboard .contributions-table .title-cell {
        max-width: 120px;
    }
}

/* Loading state inside modal */
#library_repository_stats_dashboard .modal .loading-spinner {
    text-align: center;
    padding: 40px;
}

#library_repository_stats_dashboard .modal .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bootstrap Modal Custom Styles */
#userStatsModal .modal-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

#userStatsModal .nav-tabs {
    border-bottom: 1px solid #dee2e6;
    padding: 0 1rem;
    background: #f8f9fa;
}

#userStatsModal .nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
}

#userStatsModal .nav-tabs .nav-link:hover {
    color: #667eea;
    border: none;
    background: transparent;
}

#userStatsModal .nav-tabs .nav-link.active {
    color: #667eea;
    border: none;
    border-bottom: 2px solid #667eea;
    background: transparent;
}

#userStatsModal .tab-content {
    max-height: 500px;
    overflow-y: auto;
}

#userStatsModal .card.bg-light {
    background-color: #f8f9fa !important;
}

#userStatsModal .table-borderless td,
#userStatsModal .table-borderless th {
    padding: 0.5rem 0;
}

#userStatsModal .table-borderless tr td:first-child {
    font-weight: 500;
    color: #495057;
}