/* Custom styles for the grid, using Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
}

/* Style for editable cells */
.data-input {
    width: 100%;
    height: 100%;
    text-align: center;
    border: none;
    padding: 4px 2px;
    background-color: transparent;
    font-weight: 600;
    color: #1f2937;
    transition: background-color 0.15s;
}
.data-input:focus {
    outline: none;
    background-color: #e5e7eb;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* Grid table styling */
#dataGrid th, #dataGrid td, #reportGrid th, #reportGrid td {
    padding: 0;
    border: 1px solid #d1d5db;
}
#dataGrid th, #reportGrid th {
    font-size: 0.75rem;
    line-height: 1rem;
    text-transform: uppercase;
    background-color: #1f2937;
    color: white;
    padding: 8px 4px;
}
.total-cell {
    background-color: #fcd34d; /* Yellow total cells */
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    padding: 8px 4px;
}
.header-bg-dark {
     background-color: #1f2937;
     color: white;
}
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: #e5e7eb;
    font-weight: 600;
    text-align: left;
    padding-left: 12px !important;
}

/* Container for the scrollable grid */
.grid-container {
    overflow-x: auto;
    max-width: 100vw;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
}
/* Ensure sticky headers and footers work */
#dataGrid thead, #reportGrid thead {
    position: sticky;
    top: 0;
    z-index: 20;
}
#dataGrid tfoot, #reportGrid tfoot {
    position: sticky;
    bottom: 0;
    z-index: 20;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

/* Tab styling */
.tab-button {
    padding: 10px 20px;
    border-radius: 0.5rem 0.5rem 0 0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.tab-active {
    background-color: white;
    color: #1d4ed8;
    border-bottom: 2px solid #1d4ed8;
}
.tab-inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}



/* --- Print Styles --- */

/* Screen styles for the report card */
.report-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@media print {
    /* Hide everything that isn't the print area */
    body * {
        visibility: hidden;
    }
    #printArea, #printArea * {
        visibility: visible;
    }
    
    /* Position the print area at the top left */
    #printArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Ensure background colors (headers, totals) show up in PDF */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Page Break Logic */
    .report-card {
        break-inside: avoid; /* Try not to split a table in half */
        page-break-after: always; /* Force new page after each report card */
        border: none; /* Remove border for cleaner print */
        box-shadow: none;
        margin-bottom: 0;
        padding: 0;
        padding-top: 20px;
    }
    
    /* Hide standard UI elements */
    .no-print, nav, header, button, .print\:hidden {
        display: none !important;
    }
    
    /* Reset table layout for paper width */
    .grid-container {
        max-height: none !important;
        overflow: visible !important;
        max-width: 100% !important;
    }
    .sticky-col {
        position: static !important; /* Remove sticky behavior for print */
    }
}
