/* ==============================
   MAIN CONTAINER
   ============================== */
#library_emedia_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_emedia_stats_dashboard .loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

#library_emedia_stats_dashboard .skeleton-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

#library_emedia_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_emedia_stats_dashboard .table-skeleton {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

#library_emedia_stats_dashboard .table-skeleton .skeleton-row {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
}

#library_emedia_stats_dashboard .table-skeleton .skeleton-row:first-child {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

/* Скелетон для карточек */
#library_emedia_stats_dashboard .card-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

/* ==============================
   TABS
   ============================== */
#library_emedia_stats_dashboard .tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
    background: transparent;
    flex-wrap: wrap;
}

#library_emedia_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_emedia_stats_dashboard .tab-btn:hover {
    background: #f5f5f5;
    color: #2c3e50;
}

#library_emedia_stats_dashboard .tab-btn.active {
    color: #3498db;
    border-bottom: 3px solid #3498db;
    background: #f8f9fa;
}

#library_emedia_stats_dashboard .tab-content {
    display: none;
}

#library_emedia_stats_dashboard .tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ==============================
   CARDS
   ============================== */
#library_emedia_stats_dashboard .stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

#library_emedia_stats_dashboard .stat-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_emedia_stats_dashboard .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#library_emedia_stats_dashboard .stat-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_emedia_stats_dashboard .stat-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 6px;
}

#library_emedia_stats_dashboard .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.2;
}

#library_emedia_stats_dashboard .stat-sub {
    font-size: 10px;
    color: #95a5a6;
    margin-top: 5px;
}

/* ==============================
   SECTION TITLES
   ============================== */
#library_emedia_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_emedia_stats_dashboard .section-desc {
    font-size: 11px;
    font-weight: normal;
    color: #7f8c8d;
    margin-left: 0;
}

/* ==============================
   CHARTS - 2x2 сетка
   ============================== */
#library_emedia_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_emedia_stats_dashboard .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

#library_emedia_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_emedia_stats_dashboard .chart-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#library_emedia_stats_dashboard .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 0 15px;
    flex-wrap: wrap;
    gap: 8px;
}

#library_emedia_stats_dashboard .chart-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

#library_emedia_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_emedia_stats_dashboard .chart-container {
    padding: 12px;
    flex: 1;
    min-height: 280px;
}

/* ==============================
   TOGGLE BUTTONS
   ============================== */
#library_emedia_stats_dashboard .chart-toggle {
    display: flex;
    gap: 5px;
}

#library_emedia_stats_dashboard .toggle-btn {
    padding: 4px 10px;
    background: #ecf0f1;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

#library_emedia_stats_dashboard .toggle-btn:hover {
    background: #bdc3c7;
}

#library_emedia_stats_dashboard .toggle-btn.active {
    background: #3498db;
    color: white;
}

/* ==============================
   TABLES - 1x2 сетка
   ============================== */
#library_emedia_stats_dashboard .tables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    #library_emedia_stats_dashboard .tables-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

#library_emedia_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_emedia_stats_dashboard .table-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#library_emedia_stats_dashboard .table-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

#library_emedia_stats_dashboard .table-desc {
    font-size: 10px;
    color: #95a5a6;
    margin-top: 4px;
}

/* ==============================
   PERIOD FILTER
   ============================== */
#library_emedia_stats_dashboard .period-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#library_emedia_stats_dashboard .period-btn {
    padding: 6px 14px;
    background: #ecf0f1;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

#library_emedia_stats_dashboard .period-btn:hover {
    background: #bdc3c7;
}

#library_emedia_stats_dashboard .period-btn.active {
    background: #3498db;
    color: white;
}

/* ==============================
   TABLES STYLES
   ============================== */
#library_emedia_stats_dashboard .table-container {
    background: white;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

#library_emedia_stats_dashboard .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

#library_emedia_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_emedia_stats_dashboard .data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ecf0f1;
}

#library_emedia_stats_dashboard .data-table tr:hover {
    background: #f8f9fa;
}

/* ==============================
   USERS RATING TABLE
   ============================== */
#library_emedia_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_emedia_stats_dashboard .users-rating-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 700px;
}

#library_emedia_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_emedia_stats_dashboard .users-rating-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
}

#library_emedia_stats_dashboard .users-rating-table tr:hover {
    background: #f8f9fa;
}

#library_emedia_stats_dashboard .rank {
    font-weight: bold;
    color: #3498db;
    width: 45px;
    font-size: 12px;
}

#library_emedia_stats_dashboard .user-name {
    font-weight: 500;
    color: #2c3e50;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#library_emedia_stats_dashboard .user-email {
    font-family: monospace;
    font-size: 11px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#library_emedia_stats_dashboard .user-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
}

#library_emedia_stats_dashboard .status-active {
    background: #d4edda;
    color: #155724;
}

#library_emedia_stats_dashboard .status-moderate {
    background: #fff3cd;
    color: #856404;
}

#library_emedia_stats_dashboard .status-inactive {
    background: #f8d7da;
    color: #721c24;
}

#library_emedia_stats_dashboard .status-never {
    background: #e2e3e5;
    color: #383d41;
}

#library_emedia_stats_dashboard .user-items {
    text-align: center;
    font-size: 12px;
}

#library_emedia_stats_dashboard .user-actions {
    text-align: center;
}

#library_emedia_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_emedia_stats_dashboard .btn-details:hover {
    background: #2980b9;
}

/* ==============================
   ANALYTICS GRID (3 колонки)
   ============================== */
#library_emedia_stats_dashboard .analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

@media (max-width: 1000px) {
    #library_emedia_stats_dashboard .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #library_emedia_stats_dashboard .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   MODAL WINDOW
   ============================== */
#library_emedia_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_emedia_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_emedia_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_emedia_stats_dashboard .modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

#library_emedia_stats_dashboard .modal-close {
    font-size: 28px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
    line-height: 1;
}

#library_emedia_stats_dashboard .modal-close:hover {
    color: white;
    transform: scale(1.1);
}

#library_emedia_stats_dashboard .modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    background: #f8f9fa;
}

#library_emedia_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_emedia_stats_dashboard .modal-tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

#library_emedia_stats_dashboard .modal-tab-btn.active {
    color: #667eea;
}

#library_emedia_stats_dashboard .modal-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

#library_emedia_stats_dashboard .modal-body {
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
    background: #ffffff;
}

/* User stats details inside modal */
#library_emedia_stats_dashboard .user-stats-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

#library_emedia_stats_dashboard .detail-row {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
}

#library_emedia_stats_dashboard .detail-row strong {
    color: #2c3e50;
    min-width: 150px;
    display: inline-block;
    font-weight: 600;
}

#library_emedia_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_emedia_stats_dashboard .contributions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#library_emedia_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_emedia_stats_dashboard .contributions-table td {
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
}

/* Loading states */
#library_emedia_stats_dashboard .loading-spinner {
    text-align: center;
    padding: 40px;
}

#library_emedia_stats_dashboard .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); }
}

/* Responsive */
@media (max-width: 768px) {
    #library_emedia_stats_dashboard {
        padding: 12px;
    }
    
    #library_emedia_stats_dashboard .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    #library_emedia_stats_dashboard .stat-card {
        padding: 10px 12px;
    }
    
    #library_emedia_stats_dashboard .stat-value {
        font-size: 20px;
    }
    
    #library_emedia_stats_dashboard .tab-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    #library_emedia_stats_dashboard .modal-content {
        margin: 20px auto;
        width: 95%;
    }
    
    #library_emedia_stats_dashboard .user-stats-details {
        grid-template-columns: 1fr;
    }
    
    #library_emedia_stats_dashboard .detail-divider {
        grid-column: span 1;
    }
}

/* ==============================
   MODAL WINDOW FIX (ИСПРАВЛЕННЫЙ)
   ============================== */
#library_emedia_stats_dashboard .modal {
    display: none;
    position: fixed;
    z-index: 100000;
    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;
}

#library_emedia_stats_dashboard .modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#library_emedia_stats_dashboard .modal-content {
    background-color: #ffffff;
    margin: 0 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;
    position: relative;
}

/* Для модального окна вне дашборда (глобально) */
.modal-global {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
}

.modal-global.show {
    display: flex !important;
}

.modal-global .modal-content {
    background-color: #ffffff;
    margin: 0 auto;
    width: 90%;
    max-width: 850px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-global .modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-global .modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.modal-global .modal-close {
    font-size: 28px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
    line-height: 1;
}

.modal-global .modal-close:hover {
    color: white;
    transform: scale(1.1);
}

.modal-global .modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    background: #f8f9fa;
    flex-shrink: 0;
    overflow-x: auto;
}

.modal-global .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;
    white-space: nowrap;
}

.modal-global .modal-tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.modal-global .modal-tab-btn.active {
    color: #667eea;
}

.modal-global .modal-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

.modal-global .modal-body {
    padding: 24px;
    overflow-y: auto;
    background: #ffffff;
    flex: 1;
}

.modal-global .modal-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.modal-global .modal-tab-content.active {
    display: block;
}

.modal-global .user-stats-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.modal-global .detail-row {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
}

.modal-global .detail-row strong {
    color: #2c3e50;
    min-width: 150px;
    display: inline-block;
    font-weight: 600;
}

.modal-global .detail-divider {
    grid-column: span 2;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
    margin: 12px 0;
}

.modal-global .contributions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.modal-global .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;
}

.modal-global .contributions-table td {
    padding: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-global .contributions-table tr:hover {
    background: #f8f9fa;
}

.modal-global .title-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-global .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;
}

.modal-global .text-center {
    text-align: center;
}

.modal-global .py-4 {
    padding-top: 40px;
    padding-bottom: 40px;
}

.modal-global .mt-2 {
    margin-top: 10px;
}

.modal-global .alert {
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.modal-global .alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.modal-global .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.modal-global .alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-global .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-global .modal-header {
        padding: 15px 20px;
    }
    
    .modal-global .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-global .modal-tab-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .modal-global .modal-body {
        padding: 16px;
    }
    
    .modal-global .user-stats-details {
        grid-template-columns: 1fr;
    }
    
    .modal-global .detail-divider {
        grid-column: span 1;
    }
    
    .modal-global .detail-row strong {
        min-width: 120px;
    }
    
    .modal-global .title-cell {
        max-width: 180px;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(3px);
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Стили для таблицы форматов */
#library_emedia_stats_dashboard .data-table .text-right {
    text-align: right;
}

#library_emedia_stats_dashboard .data-table td.text-right,
#library_emedia_stats_dashboard .data-table th.text-right {
    text-align: right;
}

/* ==============================
   SKELETON LOADING ANIMATIONS
   ============================== */

#library_emedia_stats_dashboard .stat-card.skeleton {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    pointer-events: none;
}

#library_emedia_stats_dashboard .skeleton-text {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

#library_emedia_stats_dashboard .stat-card.skeleton .stat-title {
    height: 12px;
    width: 60%;
    margin: 0 auto 8px;
    background: linear-gradient(90deg, #d0d0d0 25%, #e8e8e8 50%, #d0d0d0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent;
}

#library_emedia_stats_dashboard .stat-card.skeleton .stat-value {
    height: 28px;
    width: 50%;
    margin: 0 auto;
    background: linear-gradient(90deg, #d0d0d0 25%, #e8e8e8 50%, #d0d0d0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent;
}

#library_emedia_stats_dashboard .stat-card.skeleton .stat-sub {
    height: 10px;
    width: 40%;
    margin: 6px auto 0;
    background: linear-gradient(90deg, #d0d0d0 25%, #e8e8e8 50%, #d0d0d0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent;
}

/* Chart skeleton */
#library_emedia_stats_dashboard .chart-skeleton {
    padding: 15px 10px;
    position: relative;
    min-height: 250px;
}

#library_emedia_stats_dashboard .skeleton-bar {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

#library_emedia_stats_dashboard .skeleton-line-chart {
    position: relative;
    height: 180px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

#library_emedia_stats_dashboard .skeleton-line {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, #d0d0d0 25%, #e8e8e8 50%, #d0d0d0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 2px;
    left: 5%;
    width: 90%;
}

#library_emedia_stats_dashboard .skeleton-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d0d0;
    top: 50%;
    transform: translate(-50%, -50%);
}

#library_emedia_stats_dashboard .skeleton-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 0 5px;
}

#library_emedia_stats_dashboard .skeleton-legend-item {
    width: 60px;
    height: 14px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Table skeleton */
#library_emedia_stats_dashboard .table-skeleton {
    width: 100%;
    padding: 8px 12px;
}

#library_emedia_stats_dashboard .table-skeleton .skeleton-row {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

#library_emedia_stats_dashboard .table-skeleton .skeleton-row.skeleton-header {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

#library_emedia_stats_dashboard .table-skeleton .skeleton-cell {
    flex: 1;
    height: 16px;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    min-width: 20px;
}

#library_emedia_stats_dashboard .table-skeleton .skeleton-row.skeleton-header .skeleton-cell {
    height: 20px;
    background: linear-gradient(90deg, #d5d5d5 25%, #e8e8e8 50%, #d5d5d5 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Animation for content fade-in */
#library_emedia_stats_dashboard .stat-card,
#library_emedia_stats_dashboard .chart-card,
#library_emedia_stats_dashboard .table-card {
    transition: opacity 0.3s ease;
}