/* Reports Styles */
.reports-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.report-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
}

.report-tab:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.report-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.report-section {
    display: none;
}

.report-section.active {
    display: block;
}

.report-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
    padding: 30px;
    margin-top: 20px;
    transition: var(--transition);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.report-table-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
}

.report-container:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.report-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
    margin: -30px -30px 25px -30px;
}

.report-header h3 {
    margin: 0 0 10px 0;
    width: 100%;
}

.report-header p {
    margin: 0;
    width: 100%;
}

.report-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: white;
    border-radius: 2px;
}

.report-period {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Report Stats Grid */
.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-stat {
    text-align: center;
    padding: 25px;
    background: white;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.report-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.report-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
}

.report-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.report-stat-label {
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Report Table */
.report-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
    background: white;
    padding: 0;
    margin: 20px 0;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.report-table th,
.data-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--dark);
    font-weight: 700;
    text-align: center;
    padding: 15px 12px;
    border-bottom: 3px solid var(--primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
}

.data-table td {
    text-align: left;
}

.report-table th::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 50%, transparent 100%);
}

.report-table td,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    transition: var(--transition);
}

.data-table th {
    padding: 15px 12px;
}

.report-table tbody tr {
    transition: var(--transition);
}

.report-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.report-table tr:last-child td {
    border-bottom: none;
}

/* Report Charts */
.chart-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    padding: 30px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.chart-container:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto 20px;
}

.chart-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.chart-placeholder {
    height: 300px;
    background: var(--light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-style: italic;
}

/* Status Indicators */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.pending {
    background: #fed7aa;
    color: #92400e;
}

.status-badge.overdue {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.in-progress {
    background: #dbeafe;
    color: #1e40af;
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s ease;
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    color: var(--dark);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.export-btn:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Report Filters */
.report-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--dark);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* Responsive Reports - Mobile */
@media (max-width: 768px) {
    .report-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        margin: -15px -15px 20px -15px;
        padding: 15px;
    }
    
    .report-container {
        padding: 15px;
    }
    
    .report-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .report-stat {
        padding: 15px;
    }
    
    .report-stat div:first-child {
        font-size: 24px !important;
    }
    
    .report-filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .export-buttons {
        justify-content: center;
    }
    
    /* Вкладки на всю ширину */
    .reports-tabs {
        flex-direction: column;
        gap: 8px;
        padding-bottom: 10px;
    }
    
    .report-tab {
        width: 100%;
        justify-content: center;
        padding: 12px 15px;
        border-radius: 8px;
        border-bottom: none;
        background: #f8fafc;
        margin-bottom: 0;
    }
    
    .report-tab.active {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: white;
        border-bottom: none;
    }
    
    .report-tab:hover {
        background: rgba(99, 102, 241, 0.15);
    }
    
    .report-tab.active:hover {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    }
    
    /* Фільтри дат */
    .report-filters > div {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .report-filters .form-group {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    .report-filters .btn {
        width: 100%;
    }
    
    /* Таблиці з горизонтальним скролом */
    .report-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 15px -15px;
        padding: 0 15px;
        width: calc(100% + 30px);
    }
    
    .report-table,
    .data-table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .report-table th,
    .report-table td,
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    /* Заголовки таблиць */
    h4[style*="margin: 30px"] {
        margin: 20px 0 10px 0 !important;
        font-size: 14px;
    }
}

/* Responsive Reports - Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .report-container {
        padding: 20px;
    }
    
    .report-header {
        margin: -20px -20px 20px -20px;
    }
    
    .report-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .report-stat {
        padding: 18px;
    }
    
    /* Вкладки в 2 колонки */
    .reports-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding-bottom: 15px;
    }
    
    .report-tab {
        justify-content: center;
        padding: 12px 15px;
        border-radius: 8px;
        border-bottom: none;
        background: #f8fafc;
        margin-bottom: 0;
    }
    
    .report-tab.active {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: white;
        border-bottom: none;
    }
    
    .report-tab:hover {
        background: rgba(99, 102, 241, 0.15);
    }
    
    .report-tab.active:hover {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    }
    
    /* Таблиці з горизонтальним скролом */
    .report-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .report-table,
    .data-table {
        min-width: 700px;
    }
}

/* ================================
   REPORT CARDS - стилі для карток
   ================================ */

/* Приховуємо картки на десктопі */
.report-cards-mobile,
.report-section-title-mobile {
    display: none;
}

/* Стилі карток */
.report-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
}

.report-card-header {
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-card-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.report-card-title {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-card-title i {
    color: var(--primary);
    font-size: 14px;
}

.report-card-body {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.report-card-compact .report-card-body {
    grid-template-columns: repeat(2, 1fr);
}

.report-card-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-card-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-card-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
}

.report-card-footer {
    padding: 12px 15px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.report-card-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-card-progress span {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.progress-bar-mini {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Мобільні та планшети - показуємо картки, приховуємо таблиці */
@media (max-width: 1024px) {
    .report-table-desktop {
        display: none !important;
    }
    
    .report-cards-mobile,
    .report-section-title-mobile {
        display: flex !important;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .report-card-body {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .report-card-compact .report-card-body {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-card-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .report-card-compact .report-card-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        border-bottom: none;
    }
    
    .report-card-item:last-child {
        border-bottom: none;
    }
    
    .report-card-label {
        font-size: 12px;
    }
    
    .report-card-value {
        font-size: 14px;
    }
}
