/* COA Dashboard Frontend Styles */

:root {
    --primary-color: #264653;
    --secondary-color: #264653;
    --success-color: #4CAF50;
    --warning-color: #FFA000;
    --danger-color: #F44336;
    --gray-light: #f5f5f5;
    --gray-medium: #e0e0e0;
    --border-radius: 8px;
}

* {
    box-sizing: border-box;
}

.coa-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.coa-dashboard .info-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: visible;
}

.coa-dashboard .info-title {
    background: linear-gradient(90deg, #1D3557, #264653, #2A9D8F);
    color: white;
    padding: 1rem;
    border-radius: 16px;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.coa-dashboard .info-description {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.coa-dashboard .test-info-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.coa-dashboard .test-info-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.coa-dashboard .test-info-card {
    width: 100%;
}

.coa-dashboard .test-info-card h3 {
    color: #264653;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.coa-dashboard .test-info-card p {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.coa-dashboard .test-info-card ul {
    list-style-type: none;
    padding-left: 0;
}

.coa-dashboard .test-info-card li {
    color: #666;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.coa-dashboard .test-info-card li::before {
    content: "•";
    color: #264653;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.coa-dashboard .microbial-explainer-container,
.coa-dashboard .metals-explainer-container,
.coa-dashboard .alkaloid-explainer-container {
    background-color: #f2f7f9;
    border-radius: 6px;
    font-size: 0.9rem;
    overflow: hidden;
    margin-top: 1rem;
}

.coa-dashboard .microbial-header,
.coa-dashboard .metals-header,
.coa-dashboard .alkaloid-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(90deg, #e5eef2, #f2f7f9);
    transition: all 0.3s ease;
}

.coa-dashboard .microbial-header:hover,
.coa-dashboard .metals-header:hover,
.coa-dashboard .alkaloid-header:hover {
    background: linear-gradient(90deg, #d6e5eb, #e5eef2);
}

.coa-dashboard .microbial-header h4,
.coa-dashboard .metals-header h4,
.coa-dashboard .alkaloid-header h4 {
    color: #264653;
    margin: 0;
    font-size: 1.1rem;
}

.coa-dashboard .expand-icon {
    font-size: 1.5rem;
    color: #264653;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.coa-dashboard .microbial-header.active .expand-icon,
.coa-dashboard .metals-header.active .expand-icon,
.coa-dashboard .alkaloid-header.active .expand-icon {
    transform: rotate(45deg);
}

.coa-dashboard .microbial-content,
.coa-dashboard .metals-content,
.coa-dashboard .alkaloid-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    padding: 0 1rem;
}

.coa-dashboard .microbial-header.active + .microbial-content,
.coa-dashboard .metals-header.active + .metals-content,
.coa-dashboard .alkaloid-header.active + .alkaloid-content {
    max-height: 5000px;
    padding: 1rem;
    border-top: 1px solid #ddd;
    overflow-x: auto;
    overflow-y: visible;
}

.coa-dashboard .limit-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.coa-dashboard .limit-table th,
.coa-dashboard .limit-table td {
    padding: 0.5rem;
    border: 1px solid #ddd;
    text-align: left;
}

.coa-dashboard .limit-table th {
    background-color: #264653;
    color: white;
}

.coa-dashboard .limit-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.coa-dashboard .note-box {
    background-color: #e5eef2;
    border-left: 4px solid #264653;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 4px 4px 0;
}

.coa-dashboard .special-note-box {
    background-color: #f2f7f9;
    border-left: 4px solid #264653;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
}

.coa-dashboard .special-note-box h5 {
    color: #264653;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.coa-dashboard .special-note-box ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0.75rem;
}

.coa-dashboard .special-note-box li {
    margin-bottom: 0.25rem;
    padding-left: 1.2rem;
    position: relative;
}

.coa-dashboard .special-note-box li::before {
    content: "•";
    color: #264653;
    position: absolute;
    left: 0;
}

.coa-dashboard .sources-section {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #555;
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid #264653;
}

.coa-dashboard .sources-section h5 {
    color: #264653;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.coa-dashboard .source-list {
    list-style-type: none;
    padding-left: 0;
}

.coa-dashboard .source-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
    line-height: 1.4;
}

.coa-dashboard .source-list li::before {
    content: "•";
    color: #264653;
    position: absolute;
    left: 0;
}

.coa-dashboard .sources-note {
    font-style: italic;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.coa-dashboard .source-list a {
    color: #264653;
    text-decoration: none;
}

.coa-dashboard .source-list a:hover {
    text-decoration: underline;
}

.coa-dashboard .headline-container {
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.coa-dashboard .centered-headline {
    padding: 0.75rem 2rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(90deg, #2A4B6E, #264653, #2A9D8F);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin: 0 15px;
    text-align: center;
}

.coa-dashboard .divider-line {
    height: 3px;
    background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 30%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
    flex-grow: 1;
    margin-top: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    max-width: 400px;
}

/* Filter Controls */
.coa-dashboard .coa-filter-controls {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.coa-dashboard .search-container {
    position: relative;
    margin-bottom: 20px;
}

.coa-dashboard .search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.coa-dashboard .search-input:focus {
    outline: none;
    border-color: #264653;
}

.coa-dashboard .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

.coa-dashboard .filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.coa-dashboard .filter-btn {
    padding: 10px 20px;
    border: 2px solid #264653;
    background: white;
    color: #264653;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.coa-dashboard .filter-btn:hover {
    background: #f5f5f5;
}

.coa-dashboard .filter-btn.active {
    background: linear-gradient(90deg, #264653, #2A9D8F);
    color: white;
    border-color: #264653;
}

.coa-dashboard .sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.coa-dashboard .sort-container label {
    font-weight: 600;
    color: #264653;
}

.coa-dashboard .sort-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.coa-dashboard .sort-select:focus {
    outline: none;
    border-color: #264653;
}

.coa-dashboard .results-count {
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    gap: 15px;
}

.coa-dashboard .results-count #resultsCount {
    font-weight: 700;
    color: #264653;
}

.coa-dashboard .download-all-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
}

.coa-dashboard .download-all-btn {
    background: linear-gradient(135deg, #264653 0%, #2A9D8F 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.coa-dashboard .download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #2A9D8F 0%, #264653 100%);
}

.coa-dashboard .download-all-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.coa-dashboard .download-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.coa-dashboard .download-all-btn .download-icon {
    font-size: 18px;
}

.coa-dashboard .strain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.coa-dashboard .strain-card {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.coa-dashboard .strain-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.coa-dashboard .strain-header {
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    padding: 1rem;
}

.coa-dashboard .strain-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coa-dashboard .strain-batch {
    font-size: 0.875rem;
    opacity: 0.9;
}

.coa-dashboard .strain-content {
    padding: 1rem;
}

.coa-dashboard .test-date {
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.coa-dashboard .status-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Pending Results Message */
.coa-dashboard .pending-message {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #FFE0B2, #FFF3E0);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #E65100;
    animation: pulse-pending 2s ease-in-out infinite;
}

.coa-dashboard .pending-icon {
    font-size: 32px;
    line-height: 1;
}

.coa-dashboard .pending-text {
    flex: 1;
}

.coa-dashboard .pending-text strong {
    display: block;
    color: #E65100;
    font-size: 14px;
    margin-bottom: 4px;
}

.coa-dashboard .pending-text p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.coa-dashboard .strain-card.pending-results {
    border: 2px solid #FFE0B2;
}

.coa-dashboard .strain-card.pending-results:hover {
    border-color: #E65100;
}

@keyframes pulse-pending {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* Lab Reports Section */
.coa-dashboard .lab-reports-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.coa-dashboard .lab-reports-title {
    font-weight: 600;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coa-dashboard .lab-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.coa-dashboard .lab-report-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.coa-dashboard .lab-report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: white;
}

.coa-dashboard .lab-report-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Color-coded report buttons */
.coa-dashboard .lab-report-microbial {
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
}

.coa-dashboard .lab-report-microbial:hover {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
}

.coa-dashboard .lab-report-metals {
    background: linear-gradient(135deg, #1565C0, #2196F3);
}

.coa-dashboard .lab-report-metals:hover {
    background: linear-gradient(135deg, #2196F3, #1565C0);
}

.coa-dashboard .lab-report-alkaloid {
    background: linear-gradient(135deg, #7B1FA2, #9C27B0);
}

.coa-dashboard .lab-report-alkaloid:hover {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.coa-dashboard .lab-report-pesticides {
    background: linear-gradient(135deg, #F57F17, #FFA000);
}

.coa-dashboard .lab-report-pesticides:hover {
    background: linear-gradient(135deg, #FFA000, #F57F17);
}

.coa-dashboard .lab-report-general {
    background: linear-gradient(135deg, #264653, #2A9D8F);
}

.coa-dashboard .lab-report-general:hover {
    background: linear-gradient(135deg, #2A9D8F, #264653);
}

.coa-dashboard .badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.coa-dashboard .badge::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.coa-dashboard .badge-microbial {
    background: linear-gradient(90deg, #C8E6C9, #E8F5E9);
    color: #2E7D32;
}

.coa-dashboard .badge-microbial::before {
    background-color: #2E7D32;
}

.coa-dashboard .badge-metals {
    background: linear-gradient(90deg, #BBDEFB, #E3F2FD);
    color: #1565C0;
}

.coa-dashboard .badge-metals::before {
    background-color: #1565C0;
}

.coa-dashboard .badge-alkaloid {
    background: linear-gradient(90deg, #E1BEE7, #F3E5F5);
    color: #7B1FA2;
}

.coa-dashboard .badge-alkaloid::before {
    background-color: #7B1FA2;
}

.coa-dashboard .badge-pesticides {
    background: linear-gradient(90deg, #FFF8E1, #FFFDE7);
    color: #F57F17;
}

.coa-dashboard .badge-pesticides::before {
    background-color: #F57F17;
}

.coa-dashboard .badge-sold-out {
    background: linear-gradient(90deg, #FFCDD2, #FFEBEE);
    color: #D32F2F;
}

.coa-dashboard .badge-sold-out::before {
    background-color: #D32F2F;
}

.coa-dashboard .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.coa-dashboard .modal-overlay.active {
    display: flex;
}

.coa-dashboard .modal {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: modalFade 0.3s ease-out;
    box-sizing: border-box;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coa-dashboard .modal-header {
    background: linear-gradient(90deg, #1D3557, #264653, #2A9D8F);
    color: white;
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
}

.coa-dashboard .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coa-dashboard .modal-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.coa-dashboard .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.coa-dashboard .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.coa-dashboard .modal-content {
    padding: 2rem;
    overflow-y: auto;
}

.coa-dashboard .test-section {
    margin-bottom: 2.5rem;
}

.coa-dashboard .test-section:last-child {
    margin-bottom: 0;
}

.coa-dashboard .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    background: linear-gradient(90deg, white, #f5f5f5);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #264653;
}

.coa-dashboard .test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Chart Container */
.coa-dashboard .chart-container {
    margin-top: 2rem;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.coa-dashboard .chart-container canvas {
    max-height: 400px;
}

.coa-dashboard .test-item {
    background-color: var(--gray-light);
    padding: 1rem;
    border-radius: 6px;
}

.coa-dashboard .test-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Safety Indicators */
.coa-dashboard .safety-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.coa-dashboard .safety-indicator.safety-safe {
    background-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.coa-dashboard .safety-indicator.safety-warning {
    background-color: #FFA000;
    box-shadow: 0 0 5px rgba(255, 160, 0, 0.5);
}

.coa-dashboard .safety-indicator.safety-danger {
    background-color: #F44336;
    box-shadow: 0 0 5px rgba(244, 67, 54, 0.5);
}

.coa-dashboard .safety-indicator.safety-unknown {
    background-color: #9E9E9E;
}

.coa-dashboard .test-method {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.coa-dashboard .test-result {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coa-dashboard .result-value {
    font-family: monospace;
}

.coa-dashboard .result-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.coa-dashboard .status-pass {
    background-color: #E8F5E9;
    color: var(--success-color);
}

@media (max-width: 768px) {
    .coa-dashboard {
        padding: 0 10px;
    }

    .coa-dashboard .test-info-grid {
        grid-template-columns: 1fr;
    }

    .coa-dashboard .coa-filter-controls {
        padding: 15px;
    }

    .coa-dashboard .filter-btn {
        font-size: 13px;
        padding: 8px 15px;
    }

    .coa-dashboard .sort-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .coa-dashboard .sort-select {
        width: 100%;
    }

    .coa-dashboard .strain-grid {
        grid-template-columns: 1fr;
    }

    .coa-dashboard .modal-overlay {
        padding: 10px;
    }

    .coa-dashboard .modal {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 8px;
        margin: 0;
    }

    .coa-dashboard .modal-header {
        padding: 1rem;
    }

    .coa-dashboard .modal-title {
        font-size: 1.25rem;
        padding-right: 2rem;
    }

    .coa-dashboard .modal-subtitle {
        font-size: 0.9rem;
    }

    .coa-dashboard .modal-content {
        padding: 1rem;
        overflow-x: hidden;
    }

    .coa-dashboard .test-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .coa-dashboard .test-item {
        padding: 0.75rem;
        min-width: 0;
        overflow-wrap: break-word;
    }

    .coa-dashboard .test-info-card {
        min-width: 100%;
    }

    .coa-dashboard .section-title {
        font-size: 1.1rem;
        padding: 0.5rem;
    }

    .coa-dashboard .info-section {
        padding: 1rem;
        overflow: visible;
    }

    .coa-dashboard .info-title {
        font-size: 1.25rem;
        padding: 0.75rem;
    }

    /* Smaller "Current Batches" heading on tablet/mobile */
    .coa-dashboard .centered-headline {
        font-size: 1.25rem;
        padding: 0.5rem 1rem;
    }

    /* Show 2 strain cards per row on tablet/mobile */
    .coa-dashboard .strain-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .coa-dashboard .strain-card {
        margin: 0;
    }

    .coa-dashboard .strain-header {
        padding: 0.75rem;
    }

    .coa-dashboard .strain-name {
        font-size: 1rem;
    }

    .coa-dashboard .strain-batch {
        font-size: 0.75rem;
    }

    .coa-dashboard .strain-content {
        padding: 0.75rem;
    }

    .coa-dashboard .badges {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .coa-dashboard .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .coa-dashboard .test-info-group {
        overflow: visible;
    }

    /* Expandable sections on mobile */
    .coa-dashboard .microbial-explainer-container,
    .coa-dashboard .metals-explainer-container,
    .coa-dashboard .alkaloid-explainer-container {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }

    .coa-dashboard .microbial-header h4,
    .coa-dashboard .metals-header h4,
    .coa-dashboard .alkaloid-header h4 {
        font-size: 1rem;
        padding-right: 1rem;
    }

    .coa-dashboard .microbial-content,
    .coa-dashboard .metals-content,
    .coa-dashboard .alkaloid-content {
        padding: 0 0.5rem;
    }

    .coa-dashboard .microbial-header.active + .microbial-content,
    .coa-dashboard .metals-header.active + .metals-content,
    .coa-dashboard .alkaloid-header.active + .alkaloid-content {
        padding: 0.75rem 0.75rem;
        overflow-x: scroll;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    /* Table responsiveness */
    .coa-dashboard .limit-table {
        font-size: 0.75rem;
        min-width: 550px;
        width: auto;
        table-layout: auto;
    }

    .coa-dashboard .limit-table th,
    .coa-dashboard .limit-table td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    .coa-dashboard .sources-section,
    .coa-dashboard .special-note-box,
    .coa-dashboard .note-box {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    .coa-dashboard .source-list {
        font-size: 0.8rem;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    .coa-dashboard .modal-overlay {
        padding: 5px;
    }

    .coa-dashboard .modal {
        width: 100%;
        max-width: 100%;
        border-radius: 4px;
    }

    .coa-dashboard .modal-content {
        padding: 0.75rem;
    }

    .coa-dashboard .modal-title {
        font-size: 1.1rem;
    }

    .coa-dashboard .test-item {
        padding: 0.5rem;
    }

    .coa-dashboard .test-result {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .coa-dashboard .result-value {
        font-size: 0.9rem;
    }

    .coa-dashboard .test-name {
        font-size: 0.9rem;
        word-break: break-word;
    }

    .coa-dashboard .test-method {
        font-size: 0.75rem;
    }

    .coa-dashboard .section-title {
        font-size: 1rem;
    }

    /* Expandable sections on very small screens */
    .coa-dashboard .microbial-header,
    .coa-dashboard .metals-header,
    .coa-dashboard .alkaloid-header {
        padding: 0.75rem;
    }

    .coa-dashboard .microbial-header h4,
    .coa-dashboard .metals-header h4,
    .coa-dashboard .alkaloid-header h4 {
        font-size: 0.9rem;
    }

    .coa-dashboard .limit-table {
        font-size: 0.7rem;
        min-width: 450px;
    }

    .coa-dashboard .limit-table th,
    .coa-dashboard .limit-table td {
        padding: 0.3rem;
    }

    .coa-dashboard .sources-section h5,
    .coa-dashboard .special-note-box h5 {
        font-size: 0.95rem;
    }

    .coa-dashboard .info-section {
        padding: 0.75rem;
    }

    .coa-dashboard .test-info-card {
        padding: 0.75rem;
    }

    .coa-dashboard .test-info-card ul {
        font-size: 0.85rem;
    }

    /* Mobile filter improvements */
    .coa-dashboard .coa-filter-controls {
        padding: 12px;
        border-radius: 10px;
    }

    .coa-dashboard .filter-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .coa-dashboard .filter-btn {
        min-height: 44px;
        font-size: 12px;
        padding: 10px 8px;
        text-align: center;
        justify-content: center;
    }

    .coa-dashboard .filter-btn:first-child {
        grid-column: span 2;
    }

    .coa-dashboard .search-input {
        min-height: 48px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 14px 50px 14px 16px;
    }

    .coa-dashboard .search-icon {
        right: 16px;
        font-size: 20px;
    }

    .coa-dashboard .sort-select {
        min-height: 44px;
        font-size: 15px;
    }

    .coa-dashboard .download-all-btn {
        width: 100%;
        min-height: 48px;
        font-size: 15px;
        justify-content: center;
    }

    /* Strain cards on mobile */
    .coa-dashboard .strain-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .coa-dashboard .strain-card {
        border-radius: 12px;
    }

    .coa-dashboard .strain-header {
        padding: 12px 14px;
    }

    .coa-dashboard .strain-name {
        font-size: 1.1rem;
    }

    .coa-dashboard .strain-batch {
        font-size: 0.8rem;
    }

    .coa-dashboard .strain-content {
        padding: 12px 14px;
    }

    .coa-dashboard .status-badges {
        gap: 6px;
    }

    .coa-dashboard .badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    /* Lab reports on mobile */
    .coa-dashboard .lab-reports-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .coa-dashboard .lab-report-btn {
        font-size: 11px;
        padding: 8px 6px;
        min-height: 40px;
    }
}

/* ============================================
   MOBILE ENHANCED FEATURES
   Collapsible filters, back-to-top, touch feedback
   ============================================ */

/* Collapsible filter section on mobile */
.coa-dashboard .filter-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    transition: all 0.3s ease;
}

.coa-dashboard .filter-toggle:active {
    transform: scale(0.98);
}

.coa-dashboard .filter-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.coa-dashboard .filter-toggle.active .filter-toggle-icon {
    transform: rotate(180deg);
}

.coa-dashboard .filter-collapsible {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease;
    opacity: 1;
}

.coa-dashboard .filter-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Active filter indicator */
.coa-dashboard .active-filters-badge {
    display: none;
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .coa-dashboard .filter-toggle {
        display: flex;
    }

    .coa-dashboard .active-filters-badge {
        display: inline-block;
    }

    .coa-dashboard .filter-collapsible.collapsed {
        max-height: 0;
        opacity: 0;
        margin-bottom: 0;
    }
}

/* Back to top button */
.coa-dashboard .back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(38, 70, 83, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.coa-dashboard .back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.coa-dashboard .back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(38, 70, 83, 0.4);
}

.coa-dashboard .back-to-top:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .coa-dashboard .back-to-top {
        bottom: 20px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
}

/* Touch feedback for interactive elements */
@media (hover: none) and (pointer: coarse) {
    .coa-dashboard .strain-card {
        -webkit-tap-highlight-color: transparent;
    }

    .coa-dashboard .strain-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .coa-dashboard .filter-btn:active {
        transform: scale(0.95);
    }

    .coa-dashboard .lab-report-btn:active {
        transform: scale(0.95);
    }

    .coa-dashboard .download-all-btn:active {
        transform: scale(0.98);
    }
}

/* Smooth scroll behavior */
.coa-dashboard {
    scroll-behavior: smooth;
}

/* Loading skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.coa-dashboard .skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.coa-dashboard .skeleton-card {
    height: 220px;
    border-radius: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.coa-dashboard .skeleton-text {
    height: 20px;
    margin-bottom: 8px;
}

.coa-dashboard .skeleton-text.short {
    width: 60%;
}

/* Skeleton grid for initial loading */
.coa-dashboard .skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .coa-dashboard .skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .coa-dashboard .skeleton-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .coa-dashboard .skeleton-card {
        height: 180px;
    }
}

/* Pulse animation for found card */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(42, 157, 143, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(42, 157, 143, 0);
    }
}

.coa-dashboard .strain-card.highlight {
    animation: pulse 0.8s ease-out;
}

/* Improved modal for mobile */
@media (max-width: 768px) {
    .coa-dashboard .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .coa-dashboard .modal {
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
        animation: modalSlideUp 0.3s ease-out;
    }

    @keyframes modalSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .coa-dashboard .modal-header {
        border-radius: 20px 20px 0 0;
        position: relative;
        padding-top: 24px;
    }

    /* Swipe indicator handle */
    .coa-dashboard .modal-header::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 2px;
    }

    .coa-dashboard .modal-close {
        top: 24px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 1.75rem;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 50%;
    }

    .coa-dashboard .modal-content {
        padding-bottom: 40px;
        -webkit-overflow-scrolling: touch;
    }
}

/* Quick stats summary for mobile */
.coa-dashboard .quick-stats {
    display: none;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
}

.coa-dashboard .quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.coa-dashboard .quick-stat {
    text-align: center;
    padding: 12px 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.coa-dashboard .quick-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #264653;
    line-height: 1.2;
}

.coa-dashboard .quick-stat-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick stats hidden on mobile - keep simple */

/* Results count mobile improvements */
@media (max-width: 768px) {
    .coa-dashboard .results-count {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px 0;
    }

    .coa-dashboard .results-count span {
        display: inline;
    }
}

/* Improved headline on mobile */
@media (max-width: 600px) {
    .coa-dashboard .headline-container {
        margin: 1.5rem 0;
    }

    .coa-dashboard .centered-headline {
        font-size: 1.1rem;
        padding: 0.5rem 0.75rem;
        margin: 0 10px;
        white-space: nowrap;
    }

    .coa-dashboard .divider-line {
        display: none;
    }
}

/* Pull-to-refresh indicator (visual only - functionality in JS) */
.coa-dashboard .pull-indicator {
    display: none;
    text-align: center;
    padding: 16px;
    color: #666;
    font-size: 14px;
}

.coa-dashboard .pull-indicator.active {
    display: block;
}

/* ============================================
   QR CODE FEATURE
   ============================================ */

.coa-dashboard .qr-code-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 12px;
    height: 36px;
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.coa-dashboard .qr-btn-label {
    line-height: 1;
}

.coa-dashboard .qr-code-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(38, 70, 83, 0.3);
}

.coa-dashboard .strain-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.coa-dashboard .view-details-card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coa-dashboard .view-details-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(38, 70, 83, 0.3);
}

/* QR Modal */
.coa-dashboard .qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}

.coa-dashboard .qr-modal-overlay.active {
    display: flex;
}

.coa-dashboard .qr-modal {
    background: white;
    border-radius: 16px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    overflow: hidden;
    animation: modalFade 0.3s ease-out;
}

.coa-dashboard .qr-modal-header {
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    padding: 1.25rem;
}

.coa-dashboard .qr-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.coa-dashboard .qr-modal-body {
    padding: 1.5rem;
}

.coa-dashboard .qr-code-container {
    background: white;
    padding: 16px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.coa-dashboard .qr-code-container img {
    display: block;
    max-width: 200px;
    height: auto;
}

.coa-dashboard .qr-batch-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.coa-dashboard .qr-batch-info strong {
    color: #264653;
}

.coa-dashboard .qr-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.coa-dashboard .qr-modal-actions button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.coa-dashboard .qr-close-btn {
    background: #e0e0e0;
    color: #333;
    border: none;
}

.coa-dashboard .qr-close-btn:hover {
    background: #d0d0d0;
}

.coa-dashboard .qr-download-btn {
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    border: none;
}

.coa-dashboard .qr-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(38, 70, 83, 0.3);
}

/* ============================================
   SEARCH AUTOCOMPLETE
   ============================================ */

.coa-dashboard .search-container {
    position: relative;
}

.coa-dashboard .search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #264653;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.coa-dashboard .search-autocomplete.active {
    display: block;
}

.coa-dashboard .autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coa-dashboard .autocomplete-item:last-child {
    border-bottom: none;
}

.coa-dashboard .autocomplete-item:hover,
.coa-dashboard .autocomplete-item.selected {
    background: #f5f9fa;
}

.coa-dashboard .autocomplete-item .strain-name {
    font-weight: 600;
    color: #264653;
}

.coa-dashboard .autocomplete-item .batch-number {
    font-size: 0.85rem;
    color: #666;
}

.coa-dashboard .autocomplete-item mark {
    background: #FFF3CD;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* ============================================
   COMPARISON FEATURE
   ============================================ */

.coa-dashboard .compare-controls {
    display: none;
    background: linear-gradient(135deg, #FFF3CD, #FFE69C);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 2px solid #FFA000;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.coa-dashboard .compare-controls.active {
    display: flex;
}

.coa-dashboard .compare-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #856404;
}

.coa-dashboard .compare-selected {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.coa-dashboard .compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #FFA000;
}

.coa-dashboard .compare-chip .remove-compare {
    cursor: pointer;
    color: #999;
    font-weight: bold;
}

.coa-dashboard .compare-chip .remove-compare:hover {
    color: #F44336;
}

.coa-dashboard .compare-instruction {
    font-size: 12px;
    color: #856404;
    font-style: italic;
    padding: 4px 8px;
}

.coa-dashboard .compare-actions {
    display: flex;
    gap: 8px;
}

.coa-dashboard .compare-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    border: none;
    transition: all 0.3s ease;
}

.coa-dashboard .compare-now-btn {
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
}

.coa-dashboard .compare-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(38, 70, 83, 0.3);
}

.coa-dashboard .compare-now-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.coa-dashboard .clear-compare-btn {
    background: #e0e0e0;
    color: #333;
}

.coa-dashboard .clear-compare-btn:hover {
    background: #d0d0d0;
}

/* Compare checkbox on cards */
.coa-dashboard .compare-checkbox-container {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.coa-dashboard .compare-label {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #264653;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.coa-dashboard .compare-label:hover {
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.coa-dashboard .compare-label:has(.compare-checkbox:checked) {
    background: #2A9D8F;
    color: white;
    border-color: #2A9D8F;
}

.coa-dashboard .compare-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2A9D8F;
    margin: 0;
}

.coa-dashboard .compare-label-text {
    line-height: 1;
    white-space: nowrap;
}

.coa-dashboard .strain-card {
    position: relative;
}

.coa-dashboard .strain-card.compare-selected-card {
    border: 3px solid #2A9D8F;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.2);
}

/* Comparison Modal */
.coa-dashboard .compare-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 100001;
    padding: 20px;
    overflow-y: auto;
}

.coa-dashboard .compare-modal-overlay.active {
    display: flex;
}

.coa-dashboard .compare-modal {
    background: white;
    border-radius: 16px;
    max-width: 1000px;
    width: 100%;
    margin: 20px auto;
    overflow: hidden;
    animation: modalFade 0.3s ease-out;
}

.coa-dashboard .compare-modal-header {
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coa-dashboard .compare-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.coa-dashboard .compare-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coa-dashboard .compare-modal-body {
    padding: 1.5rem;
}

.coa-dashboard .compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.coa-dashboard .compare-column {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.coa-dashboard .compare-column-header {
    background: linear-gradient(135deg, #f8f9fa, #fff);
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.coa-dashboard .compare-column-header h3 {
    margin: 0 0 4px 0;
    color: #264653;
    font-size: 1.2rem;
}

.coa-dashboard .compare-column-header .batch {
    color: #666;
    font-size: 0.9rem;
}

.coa-dashboard .compare-column-body {
    padding: 1rem;
}

.coa-dashboard .compare-section {
    margin-bottom: 1.5rem;
}

.coa-dashboard .compare-section:last-child {
    margin-bottom: 0;
}

.coa-dashboard .compare-section-title {
    font-weight: 600;
    color: #264653;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.coa-dashboard .compare-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.coa-dashboard .compare-row:last-child {
    border-bottom: none;
}

.coa-dashboard .compare-row .label {
    color: #666;
}

.coa-dashboard .compare-row .value {
    font-weight: 600;
    color: #264653;
}

.coa-dashboard .compare-row .value.better {
    color: #4CAF50;
}

.coa-dashboard .compare-row .value.worse {
    color: #F44336;
}

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

    .coa-dashboard .compare-controls {
        padding: 10px 12px;
        gap: 8px;
    }

    .coa-dashboard .compare-info {
        display: none;
    }

    .coa-dashboard .compare-selected {
        flex: 1;
        justify-content: center;
    }

    .coa-dashboard .compare-chip {
        font-size: 11px;
        padding: 4px 8px;
    }

    .coa-dashboard .compare-actions {
        width: 100%;
        justify-content: center;
    }

    .coa-dashboard .compare-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .coa-dashboard .qr-modal-actions {
        flex-direction: column;
    }

    .coa-dashboard .qr-modal-actions button {
        width: 100%;
    }

    /* Hide quick stats - too cluttered */
    .coa-dashboard .quick-stats {
        display: none;
    }

    /* Cleaner card actions on mobile */
    .coa-dashboard .strain-card-actions {
        gap: 6px;
        margin-top: 10px;
        padding-top: 10px;
    }

    .coa-dashboard .view-details-card-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .coa-dashboard .qr-code-btn {
        height: 36px;
        padding: 0 10px;
        font-size: 11px;
    }

    /* Smaller compare label on mobile */
    .coa-dashboard .compare-label {
        font-size: 10px;
        padding: 3px 6px 3px 4px;
    }

    .coa-dashboard .compare-checkbox {
        width: 14px;
        height: 14px;
    }
}

/* ============================================
   PRODUCT COA CARD STYLES
   For use with [strain_coa batch="BATCH123"] shortcode
   ============================================ */

.product-coa-wrapper {
    margin: 2rem auto;
    max-width: 800px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.product-coa-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.product-coa-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.product-coa-header {
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    padding: 2rem;
    text-align: center;
}

.product-coa-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    letter-spacing: 0.5px;
}

.product-coa-strain-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.product-coa-strain-info .strain-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.product-coa-strain-info .batch-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.3rem 1rem;
    border-radius: 20px;
}

.product-coa-strain-info .test-date {
    font-size: 0.95rem;
    font-weight: 700;
    color: #000;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
}

.product-coa-content {
    padding: 2rem;
}

/* Test Summary Section */
.coa-test-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.test-summary-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid #ccc;
}

.test-summary-item:has(.badge-microbial) {
    border-left-color: #2A9D8F;
}

.test-summary-item:has(.badge-metals) {
    border-left-color: #E76F51;
}

.test-summary-item:has(.badge-alkaloid) {
    border-left-color: #F4A261;
}

.test-summary-item:has(.badge-pesticides) {
    border-left-color: #E9C46A;
}

.test-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.test-summary-header.badge-microbial {
    color: #2A9D8F;
}

.test-summary-header.badge-metals {
    color: #E76F51;
}

.test-summary-header.badge-alkaloid {
    color: #F4A261;
}

.test-summary-header.badge-pesticides {
    color: #b8860b;
}

.test-summary-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.alkaloid-quick-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.alkaloid-stat {
    background: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #264653;
    border: 1px solid #e0e0e0;
}

.alkaloid-stat strong {
    color: #F4A261;
}

/* Test Badges */
.test-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.test-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    background: white;
    border: 2px solid;
    transition: all 0.2s ease;
}

.test-badge svg {
    width: 16px;
    height: 16px;
}

.badge-microbial {
    color: #2A9D8F;
    border-color: #2A9D8F;
}

.badge-microbial:hover {
    background: #2A9D8F;
    color: white;
}

.badge-metals {
    color: #E76F51;
    border-color: #E76F51;
}

.badge-metals:hover {
    background: #E76F51;
    color: white;
}

.badge-alkaloid {
    color: #F4A261;
    border-color: #F4A261;
}

.badge-alkaloid:hover {
    background: #F4A261;
    color: white;
}

.badge-pesticides {
    color: #E9C46A;
    border-color: #E9C46A;
}

.badge-pesticides:hover {
    background: #E9C46A;
    color: white;
}

/* Pending Badge */
.pending-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #FFF3CD, #FFE69C);
    border: 2px solid #FFA000;
    border-radius: 8px;
    color: #856404;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: #FFA000;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Lab Reports Section */
.lab-reports {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #264653;
}

.lab-reports-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #264653;
    margin: 0 0 1rem 0;
}

.lab-report-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.lab-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lab-report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.lab-report-btn svg {
    width: 16px;
    height: 16px;
}

.btn-full-report {
    background: linear-gradient(135deg, #264653, #2A9D8F);
}

.btn-microbial {
    background: linear-gradient(135deg, #2A9D8F, #23B5A0);
}

.btn-metals {
    background: linear-gradient(135deg, #E76F51, #F08261);
}

.btn-pesticides {
    background: linear-gradient(135deg, #E9C46A, #F0D07A);
    color: #333;
}

/* View Details Button */
.view-details-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
}

.view-details-btn:hover {
    background: linear-gradient(135deg, #1d3945, #238c81);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38, 70, 83, 0.3);
}

.view-details-btn svg {
    width: 20px;
    height: 20px;
}

/* Learn More Link */
.coa-learn-more {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-left: 4px solid #2A9D8F;
    border-radius: 6px;
}

.coa-learn-more p {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
}

.coa-learn-more a {
    color: #2A9D8F;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.coa-learn-more a:hover {
    color: #264653;
    border-bottom-color: #264653;
}

/* Error Message */
.coa-error {
    padding: 1rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    margin: 1rem 0;
}

/* Modal Styles (extends existing modal styles) */
.coa-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.coa-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.coa-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    z-index: 1;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.coa-modal .close-modal:hover {
    color: #264653;
    background: #e0e0e0;
}

.coa-modal .modal-header {
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
}

.coa-modal .modal-header h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.coa-modal .modal-header .batch-info {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
}

.coa-modal .modal-body {
    padding: 2rem;
}

.coa-modal .test-section {
    margin-bottom: 2rem;
}

.coa-modal .section-title {
    font-size: 1.3rem;
    color: #264653;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #2A9D8F;
}

.coa-modal .test-description {
    background: #f0f7f6;
    border-left: 4px solid #2A9D8F;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}

.coa-modal .test-description p {
    margin: 0;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.6;
}

.coa-modal .results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.coa-modal .results-table th {
    background: #f8f9fa;
    color: #264653;
    font-weight: 600;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #264653;
}

.coa-modal .results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.coa-modal .results-table tr:hover {
    background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-coa-wrapper {
        margin: 1rem;
    }

    .product-coa-header {
        padding: 1.5rem;
    }

    .product-coa-title {
        font-size: 1.4rem;
    }

    .product-coa-strain-info .strain-name {
        font-size: 1.2rem;
    }

    .product-coa-content {
        padding: 1.5rem;
    }

    .test-badges {
        flex-direction: column;
    }

    .test-badge {
        width: 100%;
        justify-content: center;
    }

    .lab-report-buttons {
        flex-direction: column;
    }

    .lab-report-btn {
        width: 100%;
        justify-content: center;
    }

    .coa-modal-content {
        margin: 10px;
        max-height: 95vh;
    }

    .coa-modal .modal-header {
        padding: 1.5rem;
    }

    .coa-modal .modal-body {
        padding: 1rem;
    }

    .coa-modal .results-table {
        font-size: 0.9rem;
    }

    .coa-modal .results-table th,
    .coa-modal .results-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .product-coa-title {
        font-size: 1.2rem;
    }

    .product-coa-strain-info .strain-name {
        font-size: 1.1rem;
    }

    .product-coa-strain-info .batch-number {
        font-size: 0.95rem;
    }

    .view-details-btn {
        font-size: 1rem;
        padding: 0.85rem;
    }

    .coa-modal .results-table {
        font-size: 0.85rem;
    }
}

/* ============================================
   PRODUCT COA COMPARE (SIDE BY SIDE)
   For use with [strain_coa_compare batch1="..." batch2="..."]
   ============================================ */

.product-coa-compare-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1600px;
}

/* Adjust card width for compare view */
.product-coa-compare-wrapper .product-coa-wrapper {
    margin: 0;
    max-width: 100%;
}

/* Responsive - Stack on tablets and mobile */
@media (max-width: 1024px) {
    .product-coa-compare-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .product-coa-compare-wrapper {
        margin: 1rem;
    }
}

/* ============================================
   PRINT STYLES - FRONTEND
   ============================================ */

@media print {
    /* Reset page margins */
    @page {
        margin: 1cm;
    }

    /* Hide non-essential elements */
    .back-to-top,
    .coa-modal-close,
    .view-details-btn,
    .lab-report-btn,
    .lab-report-buttons,
    .download-all-btn,
    .coa-filter-bar,
    .back-link,
    .no-print {
        display: none !important;
    }

    /* Reset backgrounds for printing */
    body {
        background: white !important;
        color: black !important;
    }

    .coa-dashboard-wrapper,
    .product-coa-wrapper,
    .product-coa-header,
    .product-coa-content {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    /* Modal print styles - show modal content as inline */
    .coa-modal {
        position: static !important;
        display: block !important;
        background: transparent !important;
    }

    .coa-modal-content {
        position: static !important;
        max-height: none !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .coa-modal .modal-overlay {
        display: none !important;
    }

    /* Strain cards for print */
    .strain-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: white !important;
    }

    .strain-card-header {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Test badges */
    .test-badge {
        background: transparent !important;
        border: 1px solid #333 !important;
        color: black !important;
    }

    /* Status badges */
    .status-pass {
        background: #e8f5e9 !important;
        color: #2e7d32 !important;
        border: 1px solid #2e7d32 !important;
    }

    .status-fail {
        background: #ffebee !important;
        color: #c62828 !important;
        border: 1px solid #c62828 !important;
    }

    /* Tables */
    .results-table {
        border-collapse: collapse !important;
        width: 100% !important;
    }

    .results-table th,
    .results-table td {
        border: 1px solid #333 !important;
        padding: 8px !important;
    }

    .results-table thead {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Product COA card print */
    .product-coa-wrapper {
        max-width: 100% !important;
        margin: 0 !important;
    }

    .product-coa-title {
        color: black !important;
    }

    .product-coa-strain-info .strain-name,
    .product-coa-strain-info .batch-number {
        color: black !important;
    }

    /* Links */
    a {
        color: black !important;
        text-decoration: underline !important;
    }

    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    /* But not for internal links or buttons */
    a[href^="#"]:after,
    a[href^="javascript"]:after,
    .lab-report-btn[href]:after {
        content: "";
    }

    /* Page header for COA */
    .coa-print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
    }

    /* Ensure text is black */
    h1, h2, h3, h4, h5, h6,
    p, span, div {
        color: black !important;
    }

    /* Grid adjustments */
    .coa-dashboard-strains,
    .product-coa-compare-wrapper {
        display: block !important;
    }

    .coa-dashboard-strains .strain-card,
    .product-coa-compare-wrapper .product-coa-wrapper {
        width: 100% !important;
        margin-bottom: 20px !important;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS - FRONTEND
   ============================================ */

/* Focus styles */
.strain-card:focus,
.view-details-btn:focus,
.lab-report-btn:focus,
button:focus {
    outline: 3px solid #264653;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .strain-card,
    .product-coa-wrapper,
    .coa-modal-content {
        border: 2px solid #000 !important;
    }

    .test-badge,
    .status-pass,
    .status-fail {
        border: 2px solid currentColor !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .strain-card:hover {
        transform: none !important;
    }
}

/* Focus visible polyfill support */
.strain-card:focus:not(:focus-visible) {
    outline: none;
}

.strain-card:focus-visible {
    outline: 3px solid #264653;
    outline-offset: 2px;
}

/* ============================================
   FULL REPORT DROPDOWN
   ============================================ */

.full-report-container {
    position: relative;
    width: 100%;
}

.full-report-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #264653, #2A9D8F);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.full-report-toggle:hover {
    background: linear-gradient(135deg, #1d3640, #228076);
    transform: translateY(-1px);
}

.full-report-toggle.active {
    border-radius: 8px 8px 0 0;
}

.full-report-toggle .dropdown-arrow {
    transition: transform 0.3s ease;
}

.full-report-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.full-report-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #264653;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow: hidden;
}

.dropdown-content {
    padding: 8px 0;
}

.dropdown-report-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: #264653;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-report-link:last-child {
    border-bottom: none;
}

.dropdown-report-link:hover {
    background: #f5f8f7;
}

.dropdown-report-link svg {
    flex-shrink: 0;
    color: #2A9D8F;
}

.dropdown-report-link span:first-of-type {
    flex: 1;
    font-weight: 500;
}

.report-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.report-badge.badge-complete {
    background: #264653;
    color: white;
}

.report-badge.badge-microbial {
    background: #e8f5e9;
    color: #2e7d32;
}

.report-badge.badge-metals {
    background: #e3f2fd;
    color: #1565c0;
}

.report-badge.badge-pesticides {
    background: #fff3e0;
    color: #ef6c00;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .full-report-toggle {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .dropdown-report-link {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .report-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}