/* styles.css */
body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: linear-gradient(135deg, #3bb6a6 0%, #1e6fa7 100%);
    min-height: 100vh;
    color: #222;
}

.page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Page header styling */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

/* Content sections styling */
.content-section {
    margin-bottom: 40px;
    width: 100%;
}

.content-section:last-child {
    margin-bottom: 0;
}

.modern-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.20);
    margin: 0 auto;
    padding: 32px 40px;
    max-width: 80%;
    width: 80%;
    overflow-x: auto;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h1,
.main-title {
    font-size: 2.6rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-top: 48px;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(30, 111, 167, 0.10);
}

.subtitle {
    text-align: center;
    color: #e0f7fa;
    font-size: 1.15rem;
    margin-bottom: 36px;
    font-weight: 400;
}

h2 {
    margin-top: 32px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a237e;
    letter-spacing: 0.5px;
    text-align: center;
}

.section-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e6fa7;
    margin-bottom: 18px;
    margin-top: 32px;
}

.accent-line {
    width: 60px;
    height: 4px;
    background: #3bb6a6;
    border-radius: 2px;
    margin: 0 auto 24px auto;
    display: block;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 32px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(60, 60, 60, 0.07);
    border-radius: 16px;
}

th,
td {
    border: 1px solid #e0e0e0;
    padding: 10px 16px;
    text-align: center;
    font-size: 0.95rem;
}

th {
    background: #f5f7fa;
    font-weight: 600;
    font-size: 1.08rem;
    color: #26326a;
    letter-spacing: 0.2px;
}

tr:first-child th:first-child {
    border-top-left-radius: 16px;
}

tr:first-child th:last-child {
    border-top-right-radius: 16px;
}

tr:last-child td:first-child {
    border-bottom-left-radius: 16px;
}

tr:last-child td:last-child {
    border-bottom-right-radius: 16px;
}

.editable-input {
    width: 100%;
    height: 44px;
    font-size: 1rem;
    box-sizing: border-box;
    border: 1px solid #bfc7d1;
    border-radius: 8px;
    text-align: center;
    background: #f9fbfd;
    transition: border 0.2s, box-shadow 0.2s;
    outline: none;
    min-width: 120px;
}

.editable-input:focus {
    border: 1.5px solid #3bb6a6;
    box-shadow: 0 0 0 2px #e3e8fa;
    background: #fff;
}

.editable-input:hover {
    border: 1.5px solid #1e6fa7;
}

td {
    height: 56px;
    position: relative;
}

td[style*="position:relative"] {
    overflow: visible !important;
}

.autocomplete-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #cbd5e1;
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
    font-size: 1rem;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: block;
}

.autocomplete-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    text-align: left;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background: #f0fdfa;
    color: #0d9488;
}

/* Hide number input spinners for Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Hide number input spinners for Firefox */
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.batch-table .editable-input {
    min-width: 200px;
    height: 60px;
    width: 95%;
    margin: 0 auto;
    display: block;
    font-size: 1.1rem;
}

.batch-table td,
.batch-table th {
    padding: 6px 10px;
}

.batch-table td {
    height: 60px;
}

.batch-table [data-assay="factor"],
.batch-table [data-assay="blank"] {
    min-width: 120px;
    max-width: 150px;
    width: 95%;
}

.batch-table [data-assay="wt"],
.batch-table [data-assay="br"],
.batch-table [data-assay="result"],
.batch-table [data-assay="avg"] {
    min-width: 120px;
    max-width: 160px;
    width: 95%;
}

/* Additional styling for better table appearance */
.batch-table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.batch-table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #26326a;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.batch-table td {
    border: 1px solid #e0e0e0;
    vertical-align: middle;
    text-align: center;
}

.batch-table input[readonly] {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

.flex-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .modern-card {
        width: 95%;
        max-width: 95%;
        padding: 32px 24px;
    }
}

@media (max-width: 900px) {
    .flex-row {
        flex-direction: column;
        gap: 16px;
    }

    .modern-card {
        width: 98%;
        max-width: 98%;
        padding: 24px 20px;
    }
}

@media (max-width: 700px) {
    .modern-card {
        width: 100%;
        max-width: 100%;
        padding: 20px 12px;
        border-radius: 0;
    }

    table {
        width: 100%;
        font-size: 0.95rem;
    }

    th,
    td {
        padding: 8px 6px;
    }

    .editable-input {
        font-size: 0.95rem;
    }
}

/* Action Buttons */
.action-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

/* Footer styling */
.page-footer {
    margin-top: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Improved table spacing */
.content-section table {
    margin-bottom: 30px;
}

/* Better section separation */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #3bb6a6, transparent);
    margin: 30px 0;
    border-radius: 1px;
}

.add-batch-btn {
    background: linear-gradient(135deg, #3bb6a6 0%, #2e8b57 100%);
}

.add-batch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 182, 166, 0.3);
}

.export-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.home-btn {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.prev-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.next-btn {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}

/* LabQuants Logo Styles */
.labquants-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.labquants-logo i {
    font-size: 1.35rem;
    color: #3bb6a6 !important;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.logo-brand {
    font-weight: 800;
    font-size: 1.05rem;
    color: #1e3a8a;
    letter-spacing: -0.02em;
}

.logo-url {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

@media print {
    .labquants-logo {
        border: none !important;
        padding: 0 !important;
        margin-bottom: 10px !important;
        box-shadow: none !important;
    }
}

/* Premium Color Palette */
:root {
    --primary-teal: #3bb6a6;
    --primary-navy: #1e3a8a;
    --bg-slate: #f8fafc;
    --border-soft: #e2e8f0;
    --text-main: #334155;
    --text-muted: #64748b;
    --shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Premium Tab System */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 2.5rem;
    padding: 6px;
    background: #eef2f6;
    border-radius: 18px;
    width: fit-content;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.tab-btn {
    padding: 14px 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tab-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: var(--primary-navy);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.tab-btn.active i {
    color: var(--primary-teal);
    transform: scale(1.1);
}

.tab-btn:hover:not(.active) {
    color: var(--primary-navy);
    background: rgba(255, 255, 255, 0.5);
}

/* Premium Action Buttons */
.action-btn {
    padding: 14px 30px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.add-batch-btn {
    background: #eff6ff;
    color: #2563eb;
    border: 1.5px dashed #bfdbfe;
}

.add-batch-btn:hover {
    background: #dbeafe;
    transform: translateY(-2px);
}

.export-btn {
    background: linear-gradient(135deg, #3bb6a6 0%, #2a9d8f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 182, 166, 0.3);
}

.export-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 182, 166, 0.4);
}

/* Premium Batch Card Architecture */
.batch-card {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 35px;
    box-shadow: var(--shadow-premium);
}

.batch-card h3 {
    font-size: 1.25rem;
    color: var(--primary-navy);
    margin-bottom: 25px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-header-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px 25px;
    /* Separate row/column gaps */
    margin-bottom: 30px;
    background: #fbfcfe;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid #edf2f7;
}

.grid-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 0;
    border-bottom: 1.5px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-input-cell {
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid-input-cell .editable-input {
    text-align: center;
}

/* Table Perfection */
.compact-table th {
    background: #f8fafc;
    padding: 16px 12px;
    font-size: 0.7rem;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2.5px solid #f1f5f9;
}

.compact-table td {
    padding: 12px;
    vertical-align: middle;
}

/* Precise Statistics Alignment */
.batch-stats-footer {
    display: grid;
    gap: 15px;
    margin-top: 20px;
    padding: 25px 15px 0 15px;
    border-top: 2px solid #f8fafc;
}

.solid-batch-footer {
    grid-template-columns: 1fr 140px 140px;
}

.liquid-batch-footer {
    grid-template-columns: 1fr 140px 140px;
}

.stat-item {
    text-align: center;
}

.stat-item .label {
    display: block;
    font-size: 0.6rem;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.12em;
}

.stat-item .value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-navy);
    background: #f0f9ff;
    border: 1.5px solid #e0f2fe;
    padding: 10px 20px;
    border-radius: 12px;
    display: inline-block;
    min-width: 140px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@media print {

    .tabs-container,
    .nav-btn,
    .add-batch-btn,
    .no-print,
    .export-btn {
        display: none !important;
    }

    .page-container {
        padding: 0;
    }

    .modern-card {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .batch-card {
        page-break-inside: avoid;
        border: 1.5px solid #000;
        box-shadow: none;
    }
}

/* Input Polishing */
.editable-input {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    font-weight: 600 !important;
}

.editable-input:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 4px rgba(59, 182, 166, 0.1);
}