:root {
    --primary-color: #1a1a1a;
    --success-color: #0d6e5f;
    --danger-color: #991b1b;
    --warning-color: #d97706;
    --info-color: #0369a1;
    --accent-color: #2c3e50;
    --border-color: #e2e8f0;
    --muted-text: #64748b;
    --background-color: #f8fafc;
    --cash-in-color: #059669;
    --cash-out-color: #dc2626;
    --upi-color: #7c3aed;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #f1f5f9;
}

.report-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.report-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 25px;
}

.company-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.report-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
    margin: 10px 0;
}

.report-meta {
    color: var(--muted-text);
    font-size: 14px;
    margin-top: 8px;
}

.filter-section {
    background: var(--background-color);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.quick-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-filter-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.quick-filter-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

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

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-group .form-control {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.btn-filter,
.btn-print,
.btn-export {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-filter {
    background: var(--accent-color);
    color: white;
}

.btn-filter:hover {
    background: var(--primary-color);
}

.btn-print {
    background: var(--info-color);
    color: white;
}

.btn-print:hover {
    background: #075985;
}

.btn-export {
    background: var(--success-color);
    color: white;
}

.btn-export:hover {
    background: #065f46;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted-text);
    font-size: 16px;
}

.loading i {
    font-size: 24px;
    margin-right: 10px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
    transition: all 0.2s;
}

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

.summary-card h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted-text);
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-card .amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.summary-card .sub-details {
    font-size: 11px;
    color: var(--muted-text);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.summary-card .sub-details div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.summary-card.cash-in {
    border-color: var(--cash-in-color);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.summary-card.cash-in .amount {
    color: var(--cash-in-color);
}

.summary-card.cash-out {
    border-color: var(--cash-out-color);
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.summary-card.cash-out .amount {
    color: var(--cash-out-color);
}

.summary-card.net-cash {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.summary-card.net-cash .amount {
    color: var(--accent-color);
}

.summary-card.upi-in {
    border-color: var(--upi-color);
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.summary-card.upi-in .amount {
    color: var(--upi-color);
}

.summary-card.upi-out {
    border-color: var(--warning-color);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.summary-card.upi-out .amount {
    color: var(--warning-color);
}

.summary-card.net-upi {
    border-color: var(--upi-color);
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.summary-card.net-upi .amount {
    color: var(--upi-color);
}

.summary-card.total-transactions {
    border-color: var(--info-color);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.summary-card.total-transactions .amount {
    color: var(--info-color);
}

.summary-card.net-total.highlight {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-width: 3px;
}

.summary-card.net-total.highlight .amount {
    color: var(--success-color);
    font-size: 28px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

.data-table thead {
    background: var(--primary-color);
    color: white;
}

.data-table thead th {
    padding: 12px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table thead th:last-child {
    border-right: none;
}

.data-table tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: var(--background-color);
}

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

.data-table tfoot td {
    padding: 12px 10px;
    font-weight: 700;
    background: var(--background-color);
    border-top: 2px solid var(--primary-color);
    font-size: 14px;
}

.data-table tfoot tr.net-total-row td {
    background: var(--accent-color);
    color: white;
    font-size: 15px;
    padding: 14px 10px;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted-text);
    font-style: italic;
}

.transaction-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-sales {
    background: #dcfce7;
    color: #166534;
}

.badge-sales-return {
    background: #fee2e2;
    color: #991b1b;
}

.badge-customer-payment {
    background: #dbeafe;
    color: #1e40af;
}

.badge-purchase {
    background: #fef3c7;
    color: #92400e;
}

.badge-purchase-return {
    background: #e0f2fe;
    color: #075985;
}

.badge-supplier-payment {
    background: #fef2f2;
    color: #991b1b;
}

.badge-expense {
    background: #fce7f3;
    color: #9f1239;
}

.amount-positive {
    color: var(--cash-in-color);
    font-weight: 700;
}

.amount-negative {
    color: var(--cash-out-color);
    font-weight: 700;
}

.amount-upi {
    color: var(--upi-color);
    font-weight: 700;
}

@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .quick-filters {
        flex-direction: column;
    }

    .quick-filter-btn {
        width: 100%;
    }

    .data-table {
        font-size: 11px;
    }

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

@media print {
    .filter-section,
    .btn-filter,
    .btn-print,
    .btn-export {
        display: none !important;
    }

    .report-container {
        box-shadow: none;
        padding: 0;
    }

    .data-table {
        font-size: 10px;
    }
}
