/* Report Page Styles */
body {
font-family: Arial, sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.header h1 {
    font-size: 1.8rem;
    color: #333;
    margin: 0;
}

/* Filter Section */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.filter-select {
    padding: 8px 12px;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    min-width: 150px;
    cursor: pointer;
}

.filter-select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter-input {
    padding: 8px 12px;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    min-width: 150px;
}

.filter-input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Main Content - Side by Side Layout */
.report-main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.summary-section h2 {
    font-size: 1.2rem;
    color: #333;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Summary Cards - Now vertical stack */
.summary-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summary-card {
    display: flex;
    align-items: center;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.summary-card.pouch-chest {
    border-left-color: #36a2eb;
}

.summary-card.web {
    border-left-color: #ff9f40;
}

.summary-card.total {
    border-left-color: #4bc0c0;
}

.card-icon {
    font-size: 2.5rem;
    margin-right: 20px;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #333;
}

.card-value.positive {
    color: #28a745;
}

.card-value.negative {
    color: #dc3545;
}

/* Chart Section */
.chart-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-section.monthly-chart-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 1px solid #e0e8f0;
}

.chart-section h2 {
    font-size: 1.3rem;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Table Section */
.table-section {
    overflow: auto;
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-section h2 {
    font-size: 1.3rem;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: right;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.data-table th.group-header {
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.data-table th.group-header.pouch-chest {
    background: rgba(54, 162, 235, 0.1);
    color: #2171b5;
}

.data-table th.group-header.web {
    background: rgba(255, 159, 64, 0.1);
    color: #d48806;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .price {
    text-align: right;
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
}

.data-table .amount {
    text-align: right;
    font-family: 'Roboto Mono', monospace;
}

.data-table .positive {
    color: #28a745;
    font-weight: 600;
}

.data-table .negative {
    color: #dc3545;
    font-weight: 600;
}

.data-table .total {
    font-weight: 700;
}

.data-table tfoot tr {
    background: #f0f7ff;
    font-weight: 600;
}

.data-table tfoot td {
    border-top: 2px solid #007bff;
    border-bottom: none;
}

.total-row td {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
}

/* Formula Info Section */
.formula-info {
    background: #fffef5;
    border: 1px solid #f5e6a3;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.formula-info h3 {
    font-size: 1.1rem;
    color: #856404;
    margin: 0 0 12px 0;
}

.formula-info ul {
    margin: 0;
    padding-left: 20px;
}

.formula-info li {
    margin-bottom: 8px;
    color: #666;
    line-height: 1.5;
}

.formula-info strong {
    color: #333;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 60px 20px;
}

.error-container h1 {
    color: #dc3545;
    margin-bottom: 16px;
}

.error-container pre {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    text-align: left;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 992px) {
    .report-main-content {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .summary-card {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .summary-cards {
        flex-direction: column;
    }

    .summary-card {
        padding: 16px;
    }

    .card-icon {
        font-size: 2rem;
        margin-right: 12px;
    }

    .card-value {
        font-size: 1.3rem;
    }

    .chart-container {
        height: 300px;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
}

/* Print Styles */
@media print {
    .filters,
    .btn,
    .navbar {
        display: none !important;
    }

    .container {
        max-width: 100%;
    }

    .summary-card,
    .chart-section,
    .table-section {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
