/* WAM QA Checklist page */
.wam-checklist-wrap {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem 3rem;
    font-family: system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

.wam-checklist-wrap *,
.wam-checklist-wrap *::before,
.wam-checklist-wrap *::after {
    box-sizing: border-box;
}

.wam-checklist-header h1 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem;
    color: #1e293b;
}

.wam-checklist-version {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 0.35rem;
}

.wam-checklist-header p {
    color: #64748b;
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

.wam-qa-profile-hint {
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 0.5rem;
    color: #4338ca;
    font-size: 0.85rem;
}

/* ── Form ─────────────────────────────────────────────────────────────────── */
.wam-checklist-form {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    text-align: left;
}

.wam-checklist-form-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px 16px;
    align-items: end;
}

.wam-checklist-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.wam-checklist-form input,
.wam-checklist-form select {
    width: 100%;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: #fff;
}

/* Pogas bez virsraksta — izlīdzina ar select lauku (ne ar visu label kolonnu) */
.wam-checklist-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.wam-checklist-form-actions > .wam-btn-search,
.wam-checklist-form-actions > .wam-btn-run,
.wam-checklist-form-actions > .wam-btn-autotest {
    margin-top: calc(0.72rem * 1.2 + 4px);
}

.wam-checklist-form .wam-btn-search,
.wam-checklist-form .wam-btn-run,
.wam-checklist-form .wam-btn-autotest {
    height: 40px;
    padding: 0 1.1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.wam-checklist-form .wam-btn-search {
    background: #fff;
    color: #4338ca;
    border: 1.5px solid #a5b4fc;
}

.wam-checklist-form .wam-btn-search:hover { background: #eef2ff; }

.wam-checklist-form .wam-btn-run {
    background: #4f46e5;
    color: #fff;
    border: none;
}

.wam-checklist-form .wam-btn-run:hover:not(:disabled) { background: #4338ca; }
.wam-checklist-form .wam-btn-run:disabled { opacity: 0.45; cursor: not-allowed; }

.wam-checklist-form .wam-btn-autotest {
    background: #0f766e;
    color: #fff;
    border: none;
}

.wam-checklist-form .wam-btn-autotest:hover:not(:disabled) { background: #0d9488; }
.wam-checklist-form .wam-btn-autotest:disabled { opacity: 0.45; cursor: not-allowed; }

.wam-checklist-form .wam-btn-apply {
    background: #b45309;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}
.wam-checklist-form .wam-btn-apply:hover:not(:disabled) { background: #92400e; }
.wam-checklist-form .wam-btn-apply:disabled { opacity: 0.45; cursor: not-allowed; }

.wam-qa-batch-wrap {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.wam-qa-batch-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.wam-qa-batch-label textarea {
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    font-family: ui-monospace, monospace;
    font-size: 13px;
}

.wam-btn-batch-repair {
    margin-top: 10px;
    background: #7c3aed !important;
}

.wam-btn-batch-repair:hover:not(:disabled) {
    background: #6d28d9 !important;
}

.wam-qa-batch-table tr.wam-batch-needs-repair {
    background: #fff7ed;
}

.wam-qa-batch-table tr.wam-batch-missing {
    background: #fef2f2;
}

.wam-checklist-success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.wam-qa-autotest-status {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    background: #f0fdfa;
    color: #115e59;
    border: 1px solid #99f6e4;
}

.wam-qa-manual-item.is-autotest-pass { color: #166534; }
.wam-qa-manual-item.is-autotest-fail { color: #991b1b; }

.wam-qa-autotest-badge {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.wam-qa-profile-label select {
    min-width: 180px;
}

@media (max-width: 720px) {
    .wam-checklist-form-grid {
        grid-template-columns: 1fr;
    }
    .wam-checklist-form-actions {
        width: 100%;
    }
    .wam-qa-profile-label { flex: 1; min-width: 140px; }
}

/* ── Search status & results ──────────────────────────────────────────────── */
.wam-qa-search-status {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

.wam-qa-search-status.is-ok {
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
}

.wam-qa-search-status.is-fail {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.wam-qa-search-status.is-warn {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #854d0e;
}

.wam-qa-search-results {
    margin-bottom: 1rem;
    padding: 0.65rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    text-align: left;
}

.wam-qa-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    align-items: stretch;
}

.wam-qa-results-list li {
    margin: 0;
    padding: 0;
}

.wam-checklist-form button {
    font-family: inherit;
    line-height: 1.2;
}

.wam-checklist-form input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}

.wam-checklist-form input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.wam-qa-result-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    gap: 2px 12px;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    align-items: center;
}

.wam-qa-result-item:hover,
.wam-qa-result-item.selected {
    border-color: #6366f1;
    background: #eef2ff;
}

.wam-qa-thumb-wrap {
    grid-row: 1 / span 2;
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wam-qa-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
}

.wam-qa-thumb-empty {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 1.1rem;
}

.wam-qa-item-meta {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.wam-qa-item-id {
    font-weight: 700;
    color: #4338ca;
}

.wam-qa-item-sku {
    background: #f1f5f9;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #475569;
}

.wam-qa-item-title {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.35;
}

.wam-qa-selected {
    margin-bottom: 1rem;
    padding: 0.55rem 0.85rem;
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.4;
}

/* ── Compact summary (top) ──────────────────────────────────────────────── */
.wam-qa-results-top {
    margin-bottom: 1.25rem;
}

.wam-qa-compact {
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    border: 1.5px solid #c7d2fe;
    border-radius: 0.75rem;
}

.wam-qa-compact-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 0.75rem;
}

.wam-qa-compact-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.4;
    min-width: 0;
}

.wam-qa-compact-sub {
    display: block;
    margin-top: 0.2rem;
    font-weight: 500;
    font-size: 0.82rem;
    color: #475569;
}

.wam-qa-copy-json {
    padding: 0.4rem 0.9rem;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    height: 34px;
}

.wam-qa-copy-json:hover { background: #4338ca; }

.wam-qa-compact .wam-qa-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 0.65rem;
}

.wam-qa-summary span {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
}

.wam-qa-summary .pass { background: #dcfce7; color: #166534; }
.wam-qa-summary .warn { background: #fef9c3; color: #854d0e; }
.wam-qa-summary .fail { background: #fee2e2; color: #991b1b; }

.wam-qa-compact-meta {
    color: #64748b !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.wam-qa-compact-table-wrap {
    overflow-x: auto;
    margin-top: 0.35rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
}

.wam-qa-compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.wam-qa-compact-table th,
.wam-qa-compact-table td {
    padding: 0.4rem 0.6rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
}

.wam-qa-compact-table th {
    background: #f8fafc;
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.wam-qa-compact-table tr:last-child td { border-bottom: none; }

.wam-qa-compact-table .col-icon { width: 28px; text-align: center; }
.wam-qa-compact-table .col-lang { width: 42px; font-weight: 700; text-transform: uppercase; }
.wam-qa-compact-table .col-test { width: 140px; }
.wam-qa-compact-table code { font-size: 0.75rem; }

.wam-qa-compact-ok {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: #166534;
    font-weight: 600;
}

.wam-qa-compact-hint {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ── Full results ───────────────────────────────────────────────────────── */
.wam-qa-details-full {
    margin-bottom: 1rem;
}

.wam-qa-manual,
.wam-qa-dimensions {
    margin: 1rem 0 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.wam-qa-manual summary,
.wam-qa-dimensions summary {
    cursor: pointer;
    font-weight: 600;
    color: #475569;
}

.wam-qa-manual-list {
    margin: 0.75rem 0 0;
    padding-left: 0;
    list-style: none;
}

.wam-qa-manual-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    cursor: pointer;
}

.wam-qa-dimensions ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.wam-qa-details-full summary {
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.wam-qa-checks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}

.wam-qa-checks-table th,
.wam-qa-checks-table td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.wam-qa-checks-table th { background: #f1f5f9; }

.wam-qa-status-pass { color: #16a34a; }
.wam-qa-status-warn { color: #ca8a04; }
.wam-qa-status-fail { color: #dc2626; }

.wam-qa-lang-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.wam-qa-lang-tab {
    padding: 0.35rem 0.85rem;
    border: 1px solid #e0e7ff;
    background: #fff;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.wam-qa-lang-tab.active {
    background: #e0e7ff;
    border-color: #6366f1;
    color: #4338ca;
}

.wam-qa-lang-panel { display: none; }
.wam-qa-lang-panel.active { display: block; }

.wam-qa-field {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.wam-qa-field strong {
    display: block;
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.wam-qa-json-wrap {
    margin-top: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.wam-qa-json-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0.55rem 1rem;
    background: #f1f5f9;
    font-size: 0.8rem;
    font-weight: 600;
}

.wam-qa-json-pre {
    margin: 0;
    padding: 1rem;
    max-height: 320px;
    overflow: auto;
    font-size: 0.72rem;
    background: #0f172a;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
}

.wam-checklist-error {
    padding: 0.75rem 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 0.5rem;
    font-size: 0.88rem;
}

.wam-checklist-loading {
    color: #64748b;
    font-size: 0.9rem;
}
