* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #E8F8F5 0%, #D5F3EF 50%, #C3EDE8 100%);
    min-height: 100vh;
    padding: 18px;
    color: #2d4a4a;
    user-select: text;
    font-size: 11px;
    line-height: 1.4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(78, 205, 196, 0.15);
    padding: 25px;
    border: 1px solid rgba(78, 205, 196, 0.2);
    backdrop-filter: blur(20px);
}

h1 {
    text-align: center;
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 700;
    color: #2d4a4a;
    line-height: 1.3;
}

h2 {
    text-align: left;
    margin: 12px 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #2d4a4a;
    background: linear-gradient(135deg, #F0F9F7, #E8F8F5);
    padding: 8px 12px;
    border-left: 4px solid #4ECDC4;
    line-height: 1.3;
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    font-size: 11px;
    background: white;
    border: 1px solid #B2DFDB;
    table-layout: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.1);
    border-spacing: 0;
}

th, td {
    border: 1px solid #E0F2F1;
    padding: 3px 2px;
    text-align: center;
    min-width: 48px;
    width: 48px;
    max-width: 78px;
    height: 26px;
    position: relative;
    user-select: text;
    margin: 0;
    border-spacing: 0;
}

th {
    background: linear-gradient(135deg, #F0F9F7, #E8F8F5) !important;
    color: #2d4a4a !important;
    font-weight: 600;
    font-size: 11px;
    border: 1px solid #B2DFDB;
    user-select: text;
    line-height: 1.1;
    text-shadow: none;
    padding: 6px 2px;
    height: 32px;
}

td {
    background-color: white;
    color: #1a1a1a;
    font-size: 11px;
    font-weight: 500;
    cursor: text;
    line-height: 1.1;
    text-shadow: 0.3px 0.3px 0px rgba(0,0,0,0.05);
}

tr:nth-child(even) td {
    background-color: #FBFDFB;
}

tr:hover td {
    background-color: #F0F9F7;
    transition: background-color 0.3s ease;
}

/* Add extra space between header and first data row */
thead tr:last-child th {
    border-bottom: 2px solid #B2DFDB;
    padding-bottom: 8px;
}

tbody tr:first-child td {
    border-top: 2px solid #E0F2F1;
    padding-top: 5px;
}

input[type="text"] {
    width: 95%;
    border: none;
    padding: 2px 2px;
    background-color: transparent;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    height: 22px;
    color: #1a1a1a;
    outline: none;
    font-family: inherit;
    margin: 0 auto;
    line-height: 1.1;
    transition: all 0.3s ease;
    text-shadow: 0.3px 0.3px 0px rgba(0,0,0,0.05);
}

input[type="text"]:focus {
    background-color: white;
    border: 2px solid #4ECDC4;
    box-shadow: 0 0 0 2px rgba(78, 205, 196, 0.2);
    border-radius: 4px;
}

input[type="text"]:hover {
    background-color: #F8FDFC;
}

input[type="text"][readonly] {
    background-color: #F0F9F7 !important;
    color: #5a7a7a !important;
    cursor: default !important;
    font-weight: 600 !important;
    border: 1px solid #E0F2F1 !important;
}

input[type="text"][readonly]:hover {
    background-color: #E8F8F5 !important;
}

input[type="text"][readonly]:focus {
    background-color: #E8F8F5 !important;
    border: 1px solid #B2DFDB !important;
    box-shadow: none !important;
}

.section {
    margin-bottom: 12px;
}

#sample-analysis-container .section {
    margin-bottom: 18px;
}

.lod-loq-legend {
    background: linear-gradient(135deg, #F0F9F7, #E8F8F5);
    border: 1px solid #B2DFDB;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 10px 0;
    font-size: 9px;
    color: #5a7a7a;
    line-height: 1.3;
}

.lod-loq-legend .legend-item {
    display: inline-block;
    margin-right: 18px;
}

.lod-loq-legend .legend-color {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.legend-bdl { background-color: #FFCDD2; }
.legend-bql { background-color: #FFF3E0; }
.legend-quantifiable { background-color: #E8F8F5; }
.legend-mixed { background-color: #E1F5FE; }

.print-controls {
    text-align: center;
    margin: 25px 0;
    background: rgba(255, 255, 255, 0.8);
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #B2DFDB;
    backdrop-filter: blur(10px);
}

.print-controls button {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 0 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}

.print-controls button:hover {
    background: linear-gradient(135deg, #44A08D, #2E8B8B);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(78, 205, 196, 0.4);
}

/* Organization/Product Table Specific Styles */
.org-product-table {
    table-layout: fixed !important;
}

.org-product-table td {
    max-width: none !important;
    width: auto !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.org-product-table td:first-child {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    background: linear-gradient(135deg, #F0F9F7, #E8F8F5);
    font-weight: 600;
    text-align: left;
    padding-left: 12px;
}

.org-product-table td:last-child {
    width: auto !important;
    max-width: none !important;
}

/* Solvent Name Column Specific Styles */
th:nth-child(2), td:nth-child(2) {
    min-width: 120px !important;
    max-width: 150px !important;
    width: 130px !important;
}

/* Standard Preparation Table - Sr. No column (1st column) */
#std-prep th:nth-child(1),
#std-prep td:nth-child(1) {
    min-width: 35px !important;
    max-width: 45px !important;
    width: 40px !important;
}

/* Standard Preparation Table - Name Of Solvent column (2nd column) */
#std-prep th:nth-child(2),
#std-prep td:nth-child(2) {
    min-width: 150px !important;
    max-width: 170px !important;
    width: 160px !important;
}

/* Standard Area Table - Name Of Solvent column (2nd column) */
#std-area-table th:nth-child(2),
#std-area-table td:nth-child(2) {
    min-width: 120px !important;
    max-width: 150px !important;  
    width: 130px !important;
}

/* Solvent Specifications Table - Name Of Solvent column (2nd column) */
#solvent-specs th:nth-child(2),
#solvent-specs td:nth-child(2) {
    min-width: 120px !important;
    max-width: 150px !important;
    width: 130px !important;
}

/* Sample Analysis Tables - Name Of Solvent column (2nd column) */
#sample-analysis-container table th:nth-child(2),
#sample-analysis-container table td:nth-child(2) {
    min-width: 120px !important;
    max-width: 150px !important;
    width: 130px !important;
}

/* Sample Analysis Tables - Batch Number column (3rd column) */
#sample-analysis-container table th:nth-child(3),
#sample-analysis-container table td:nth-child(3) {
    min-width: 100px !important;
    max-width: 130px !important;
    width: 110px !important;
}

/* Sample Analysis Tables - Batch Number input fields */
#sample-analysis-container table td:nth-child(3) input,
#sample-analysis-container table th:nth-child(2) input {
    min-width: 180px !important;
    width: 180px !important;
    max-width: 200px !important;
}

/* Specific targeting for batch number inputs by ID */
input[id^="batch-no-"] {
    min-width: 180px !important;
    width: 180px !important;
    max-width: 200px !important;
}

/* Sample Analysis Tables - B.No header column */
#sample-analysis-container table th:nth-child(2) {
    min-width: 180px !important;
    width: 180px !important;
    max-width: 200px !important;
}

/* Print Styles */
@media print {
    body {
        padding: 0;
        margin: 0;
        font-size: 9px;
        background-color: #fff;
    }
    .container {
        box-shadow: none;
        border: none;
        padding: 10px;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    h1 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    h2 {
        font-size: 12px;
        margin-top: 10px;
    }
    th, td {
        padding: 2px 3px;
        font-size: 8px;
    }
    .summary-table, .config-table {
        page-break-inside: avoid;
    }
    .print-controls {
        display: none;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 12px;
    }
    
    .container {
        padding: 20px 15px;
        border-radius: 16px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    h2 {
        font-size: 1.1rem;
        padding: 10px 12px;
    }
    
    /* Make tables scrollable horizontally on mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border-radius: 8px;
        font-size: 10px;
    }
    
    th, td {
        padding: 4px 6px;
        font-size: 9px;
        min-width: 60px;
        height: 30px;
    }
    
    input[type="text"] {
        padding: 6px 8px;
        font-size: 16px; /* Prevents zoom on iOS */
        width: 90%;
    }
    
    .print-controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .print-controls button {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
        font-size: 11px;
    }
    
    .container {
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1rem;
        padding: 8px 10px;
    }
    
    th, td {
        padding: 3px 4px;
        font-size: 8px;
        min-width: 50px;
        height: 28px;
    }
    
    input[type="text"] {
        padding: 4px 6px;
        font-size: 16px;
        width: 85%;
    }
    
    .print-controls button {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}
}