.target-matrix { padding:20px; }
.matrix-toolbar,.matrix-tabs { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px; }
.matrix-toolbar h2 { margin:0 auto 0 0; }
.matrix-toolbar input,.matrix-toolbar select { width:auto;max-width:200px;margin:0;background:white;color:var(--text);border:1px solid var(--border);border-radius:5px;padding:8px 10px; }
.matrix-toolbar input[type=number] { width:90px; }
.matrix-tabs { gap:2px;margin:18px 0 0;border-bottom:1px solid var(--border); }
.matrix-tabs button { background:#f6f8fc;color:var(--text);border:1px solid transparent;border-radius:5px 5px 0 0;padding:10px 22px; }
.matrix-tabs button[aria-selected=true] { background:white;color:#2563eb;border-color:var(--border);border-bottom-color:white;position:relative;top:1px; }
.matrix-tabs select { margin-left:12px;padding:7px;background:white;border:1px solid var(--border);border-radius:4px; }
.matrix-scroll { overflow:auto;max-height:65vh;border:1px solid var(--border);border-top:0;border-radius:0 0 6px 6px; }
.matrix-table { border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-variant-numeric:tabular-nums; }
.matrix-table th,.matrix-table td { min-width:122px;padding:8px;border-bottom:1px solid #edf0f4;background:white;text-align:right;font-size:13px; }
.matrix-table thead th { position:sticky;top:0;z-index:3;height:42px;color:var(--text);font-weight:600; }
.matrix-table th:first-child { position:sticky;left:0;z-index:2;min-width:168px;max-width:220px;text-align:left;white-space:nowrap;padding-left:14px;box-shadow:1px 0 #edf0f4; }
.matrix-table thead th:first-child,.matrix-table tfoot th:first-child { z-index:4; }
.matrix-table tfoot th,.matrix-table tfoot td { position:sticky;bottom:0;z-index:3;background:#fafbfd;border-top:1px solid var(--border);border-bottom:0;font-weight:650; }
.matrix-table input { width:100%;box-sizing:border-box;margin:0;padding:7px 8px;height:34px;border:1px solid #d5ddeb;border-radius:4px;background:white;color:var(--text);text-align:right;font:inherit;outline:none; }
.matrix-table input:focus { border-color:#397cf6;box-shadow:0 0 0 2px #397cf619; }
.matrix-table input[data-source=details] { color:#64748b;background:#fafbfd;border-style:dashed; }
.matrix-table input[data-save=error] { border-color:#dc2626;background:#fff7f7; }
.matrix-table input::placeholder { font-size:11px;color:#a0a8b6; }
.matrix-total { min-width:145px!important;background:#fafbfd!important; }
.matrix-status { min-height:22px;margin:10px 0;color:#64748b;font-size:12px; }
.matrix-status[data-error=true] { color:#b91c1c; }
.matrix-import { margin-top:16px;padding:16px;background:#f8fafc;border:1px solid var(--border);border-radius:6px; }
.matrix-import table { width:100%; }
.matrix-import-scroll { max-height:240px;overflow:auto; }
.matrix-legacy { margin-top:20px; }
.matrix-legacy > summary { cursor:pointer;padding:15px;color:#64748b; }
.matrix-note { color:#64748b;font-size:12px;line-height:1.7;margin:12px 0 0; }
@media(max-width:700px) {.target-matrix{padding:12px}.matrix-toolbar h2{width:100%}.matrix-table th:first-child{min-width:125px}.matrix-scroll{max-height:62vh}.matrix-tabs button{padding:9px 13px}}
/* The annual matrix uses the available desktop width; narrow screens scroll inside it. */
.layout:has(#sec-targets.active) { max-width:none; }
.matrix-table { table-layout:fixed;width:100%;min-width:1510px; }
.matrix-table th,.matrix-table td { min-width:0;width:100px; }
.matrix-table th:first-child { width:150px;min-width:150px; }
.matrix-table .matrix-total { width:115px;min-width:0!important; }
.matrix-table input { min-width:0; }

/* Keep the next step alongside the SKU editor, above long detail lists. */
#skuTargetNew{padding:16px;background:#f8faff;border:1px solid #c8d6ef;border-radius:5px;margin:12px 0}#skuTargetStatus{padding:10px 0;font-size:14px;line-height:1.6}#skuTargetStatus[data-error=true]{padding:12px;background:#fff1f0;border:1px solid #fecaca;border-radius:4px}#skuTargetPreview{margin:12px 0;padding:18px;border:1px solid #aabffc;background:#f6f9ff;border-radius:5px;scroll-margin-top:80px}#skuTargetPreview[hidden]{display:none}#skuTargetPreview h3{margin:0 0 12px;font-size:16px}.sku-receipt{width:100%;font-size:13px;border-collapse:collapse;margin:12px 0}.sku-receipt th,.sku-receipt td{padding:9px;border:1px solid #d9e2f2;text-align:right}.sku-receipt th:first-child{text-align:left}#skuImportTotals{overflow:auto}#skuImportTotals p{color:#53647d}#skuTargetApply{margin-top:12px}

/* Show the exact target opened from a pending achievement card. */
.sku-review-notice{padding:12px;margin:0 0 14px;border-left:3px solid #d97706;background:#fff8e8;color:#704613;line-height:1.7}
.sku-review-selected td{background:#fff8e8!important;border-top:1px solid #f2d29b;border-bottom:1px solid #f2d29b}
.sku-review-summary{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:10px 0;font-size:14px}
.sku-review-summary[hidden]{display:none}
.sku-review-summary button,.sku-review-action{color:#285be5;background:transparent;border:0;padding:4px 2px;font:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.sku-review-summary button[aria-pressed=true]{font-weight:700;color:#1740aa}
.sku-review-summary button:disabled{color:#7b879b;text-decoration:none;cursor:default}
.sku-review-summary button:focus-visible,.sku-review-action:focus-visible{outline:2px solid #285be5;outline-offset:2px}
.sku-review-action{display:block;margin:4px auto 0;font-size:12px}
#skuTargetStatus:empty{display:none}
#skuTargetNew,#skuWaitingNotice{scroll-margin-top:80px}
#skuTargetSearch{max-width:360px;width:320px}
.sku-error-editor{margin:12px 0;padding:14px;border:1px solid #f0c8c8;background:#fffafa;border-radius:4px}
.sku-error-editor summary{cursor:pointer;font-weight:650;color:#8a251f}
#skuErrorRows{padding:0;margin:0;border:0;min-width:0}
.sku-error-row{min-width:0;margin:12px 0;padding:12px;border:1px solid #e0e6ef;background:white}
.sku-error-row legend{font-weight:600;padding:0 6px}
.sku-error-row p{margin:0 0 10px}
.sku-error-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 16px}
.sku-error-fields label{display:flex;flex-direction:column;align-items:stretch;gap:5px;font-size:13px;color:#4b5b73}
.sku-error-fields input{box-sizing:border-box;width:100%;min-width:0;border:1px solid #cbd5e1;background:#fff;padding:7px 9px}
.sku-error-field{color:#b42318!important}.sku-error-field input{border-color:#dc6b68;background:#fff4f3}
@media(max-width:900px){.sku-error-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.sku-error-fields{grid-template-columns:1fr}}
