/* Enhanced Reports Styles */
.reports-page {
    padding: 0;
    background: #f8fafc;
    min-height: 100vh;
}

/* Header Styles */
.reports-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0 0 20px 20px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-main h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-main p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
    font-weight: 300;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.date-range-picker {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.date-range-picker:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Section Titles */
.section-title {
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title p {
    color: #718096;
    margin: 0;
    font-size: 1rem;
}

/* Export Cards */
.export-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.export-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.export-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.export-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #667eea;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.export-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.export-card:hover::before {
    transform: scaleX(1);
}

.export-card.highlight {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

.export-card.highlight::before {
    background: #4CAF50;
}

.export-card.premium {
    border-color: #ff9800;
    background: linear-gradient(135deg, #fffaf0 0%, #ffffff 100%);
}

.export-card.premium::before {
    background: #ff9800;
}

.export-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.export-icon.production { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.export-icon.sales { background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%); }
.export-icon.stock { background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%); }
.export-icon.barn { background: linear-gradient(135deg, #2196F3 0%, #1976d2 100%); }
.export-icon.summary { background: linear-gradient(135deg, #9C27B0 0%, #7b1fa2 100%); }
.export-icon.complete { background: linear-gradient(135deg, #607d8b 0%, #455a64 100%); }

.export-content {
    flex: 1;
}

.export-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.export-content p {
    margin: 0 0 1rem 0;
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.4;
}

.export-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.export-stats .stat {
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    color: #4a5568;
    font-weight: 500;
}

.export-stats .update {
    color: #a0aec0;
}

.export-actions {
    display: flex;
    align-items: flex-end;
}

.btn-export {
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.export-card.highlight .btn-export {
    background: #4CAF50;
}

.export-card.highlight .btn-export:hover {
    background: #45a049;
}

.export-card.premium .btn-export {
    background: #ff9800;
}

.export-card.premium .btn-export:hover {
    background: #f57c00;
}

/* Performance Section */
.performance-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.performance-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.performance-card:hover {
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.performance-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.performance-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.performance-badge.excellent {
    background: #c6f6d5;
    color: #22543d;
}

.performance-badge.good {
    background: #fed7d7;
    color: #742a2a;
}

.performance-badge.warning {
    background: #feebc8;
    color: #744210;
}

.performance-metric {
    margin-bottom: 1rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.9rem;
    color: #718096;
}

.performance-chart.mini {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.performance-chart.mini .chart-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.performance-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #718096;
}

.trend-up {
    color: #38a169;
}

.trend-down {
    color: #e53e3e;
}

/* Data Preview Section */
.data-preview-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.preview-tabs-container {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.tabs-header {
    background: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.tabs-navigation {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #718096;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #edf2f7;
    color: #4a5568;
}

.tab-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.tabs-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: #a0aec0;
}

.search-input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 250px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-filter {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.tabs-content {
    background: white;
}

.tab-pane {
    display: none;
    padding: 0;
}

.tab-pane.active {
    display: block;
}

/* Modern Table Styles */
.table-container {
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.modern-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.modern-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
    background: #f7fafc;
}

.modern-table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Custom Cell Styles */
.date-cell {
    display: flex;
    flex-direction: column;
}

.date-main {
    font-weight: 600;
    color: #2d3748;
}

.date-year {
    font-size: 0.8rem;
    color: #a0aec0;
}

.barn-cell .barn-name {
    font-weight: 600;
    color: #2d3748;
}

.barn-cell .barn-location,
.barn-cell .barn-code {
    font-size: 0.8rem;
    color: #a0aec0;
}

.customer-cell .customer-name {
    font-weight: 600;
    color: #2d3748;
}

.customer-cell .customer-phone {
    font-size: 0.8rem;
    color: #a0aec0;
}

.number-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.number-value {
    font-weight: 700;
    color: #2d3748;
}

.number-label {
    font-size: 0.8rem;
    color: #a0aec0;
}

.quantity-cell .quantity-main {
    font-weight: 600;
    color: #2d3748;
}

.quantity-cell .quantity-sub {
    font-size: 0.8rem;
    color: #a0aec0;
}

.amount-cell .amount-value {
    font-weight: 700;
    color: #2d3748;
}

.amount-cell .amount-method {
    font-size: 0.8rem;
    color: #a0aec0;
    text-transform: capitalize;
}

.location-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
}

.location-cell i {
    color: #a0aec0;
}

/* Score and Progress Styles */
.score-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.score-progress {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-bar.excellent { background: #38a169; }
.progress-bar.good { background: #d69e2e; }
.progress-bar.fair { background: #ed8936; }
.progress-bar.high { background: #38a169; }
.progress-bar.medium { background: #d69e2e; }
.progress-bar.low { background: #e53e3e; }

.score-value {
    font-weight: 600;
    color: #4a5568;
    min-width: 40px;
    text-align: right;
}

/* Availability Indicator */
.availability-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.availability-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.availability-indicator.high {
    background: #c6f6d5;
    color: #22543d;
}

.availability-indicator.medium {
    background: #feebc8;
    color: #744210;
}

.availability-indicator.low {
    background: #fed7d7;
    color: #742a2a;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Usage Cell */
.usage-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.usage-progress {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.usage-value {
    font-weight: 600;
    color: #4a5568;
    min-width: 45px;
    text-align: right;
}

/* Badge Styles */
.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.type-badge.perdana { background: #e3f2fd; color: #1976d2; }
.type-badge.kecil { background: #f3e5f5; color: #7b1fa2; }
.type-badge.sedang { background: #e8f5e8; color: #388e3c; }
.type-badge.besar { background: #fff3e0; color: #f57c00; }
.type-badge.super { background: #fce4ec; color: #c2185b; }
.type-badge.putih { background: #f5f5f5; color: #616161; }
.type-badge.retak { background: #ffebee; color: #d32f2f; }

.status-badge {
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: capitalize;
}

.status-badge.completed,
.status-badge.paid,
.status-badge.active {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.pending {
    background: #feebc8;
    color: #744210;
}

.status-badge.failed,
.status-badge.inactive {
    background: #fed7d7;
    color: #742a2a;
}

.status-badge.maintenance {
    background: #e9d8fd;
    color: #553c9a;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #718096;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #4a5568;
    transform: translateY(-1px);
}

.btn-action.view:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.btn-action.export:hover {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.btn-action.receipt:hover {
    background: #ff9800;
    border-color: #ff9800;
    color: white;
}

.btn-action.adjust:hover {
    background: #2196F3;
    border-color: #2196F3;
    color: white;
}

.btn-action.manage:hover {
    background: #9C27B0;
    border-color: #9C27B0;
    color: white;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 3rem;
    color: #a0aec0;
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-data p {
    margin: 0;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .export-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .performance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .reports-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .date-range-picker,
    .btn-refresh {
        width: 100%;
        justify-content: center;
    }
    
    .export-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .performance-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs-navigation {
        justify-content: center;
    }
    
    .tabs-actions {
        justify-content: center;
    }
    
    .search-input {
        width: 100%;
    }
    
    .modern-table {
        font-size: 0.8rem;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .reports-header {
        padding: 1.5rem;
    }
    
    .header-main h1 {
        font-size: 1.75rem;
    }
    
    .export-section,
    .performance-section,
    .data-preview-section {
        padding: 1.5rem;
    }
    
    .tabs-navigation {
        flex-direction: column;
    }
    
    .tab-btn {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        width: 28px;
        height: 28px;
    }
}

/* Print Styles */
@media print {
    .reports-header,
    .tabs-header,
    .action-buttons {
        display: none;
    }
    
    .reports-page {
        background: white;
        padding: 0;
    }
    
    .export-card,
    .performance-card {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
    
    .modern-table {
        font-size: 10pt;
    }
}