/* ==========================================================================
   Assaying: Lab dashboard + Traceability (approved design: assaying-mockup.html). Scoped to .as.
   ========================================================================== */
.as {
    --line2: #EEF1F6; --ink2: #3A4557; --blue-bg: #EAF0FE; --gold: #B8913A; --violet: #7B61D9;
    display: flex; flex-direction: column; gap: 16px; max-width: 1500px; margin: 0 auto; padding-bottom: 24px;
}
.as .num, .as .mono { font-family: "SF Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }
.as-card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 0 10px 26px -18px rgba(20,30,50,.25); min-width: 0; }
.as-card h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.as .sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.as-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.as-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.as-pill.g { background: var(--green-bg); color: #0B7A45; } .as-pill.a { background: var(--amber-bg); color: #8A5A00; }
.as-pill.r { background: var(--red-bg); color: #B4364A; } .as-pill.b { background: var(--blue-bg); color: var(--blue); } .as-pill.n { background: #EDF1F7; color: var(--muted); }
.as .lod { color: #A3AEC4; font-size: 11.5px; }
.as-waiting { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: #FFF8E8; border: 1px solid #F1D59C; color: #7A4B00; font-size: 13px; }
.as-waiting b { display: block; font-size: 14px; color: #5C3A00; }

/* Source strip */
.as-sources { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.as-src { background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.as-src b { font-size: 12.5px; } .as-src span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-src .st { font-size: 11px; font-weight: 600; } .as-src .st.g { color: var(--green); } .as-src .st.a { color: var(--amber); } .as-src .st.r { color: var(--red); } .as-src .st.n { color: var(--muted); }

/* Environment tiles */
.as-env { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.as-tile { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 10px; border-top: 4px solid var(--blue); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.as-tile.warn { border-top-color: var(--amber); } .as-tile.bad { border-top-color: var(--red); } .as-tile.gold { border-top-color: var(--gold); }
.as-tile .lbl { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; gap: 6px; }
.as-tile .val { font-size: 26px; font-weight: 700; line-height: 1.1; } .as-tile .val small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.as-tile .lim { font-size: 11px; color: var(--muted); }
.as-tile svg { width: 100%; height: 38px; display: block; }

/* Rows */
.as-row { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.as-row.icp { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.as table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.as th { text-align: left; font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 8px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.as td { padding: 7px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.as tbody tr:last-child td { border-bottom: 0; } .as tbody tr:hover td { background: #F8FAFE; }
.as tr.sel td { background: #EEF3FE; } .as tr.clk { cursor: pointer; }
.as-scroll { max-height: 330px; overflow: auto; }
.as svg.chart { width: 100%; display: block; }
.as-input, .as select { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid #DCE3EF; border-radius: 8px; background: #F7F9FC; color: var(--text); }
.as-eq { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); margin: 6px 0 4px; } .as-eq b { color: var(--text); }
.as-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.as-k { background: #F7F9FC; border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px; }
.as-k span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; } .as-k b { display: block; font-size: 18px; }
.as-empty { padding: 22px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed #D6DEEC; border-radius: 10px; background: #FAFBFE; }

/* Traceability */
.as-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.as-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.as-filters .as-input[type=search] { width: 280px; }
.as-btn { font: inherit; font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 8px; border: 1px solid #DCE3EF; background: #FFFFFF; cursor: pointer; color: var(--ink2); }
.as-btn.p { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }
.as-trace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.as-prod { display: flex; flex-direction: column; gap: 10px; }
.as-prod .big { font-size: 20px; font-weight: 700; word-break: break-all; }
.as-prod dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12.5px; } .as-prod dt { color: var(--muted); } .as-prod dd { margin: 0; font-weight: 600; }
.as-months { display: flex; gap: 6px; flex-wrap: wrap; }
.as-months button { font: inherit; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink2); cursor: pointer; }
.as-months button.on { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.as-months button:disabled { opacity: .45; cursor: default; }
.as-tl { position: relative; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.as-tl::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.as-ev { position: relative; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: grid; grid-template-columns: 70px 100px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.as-ev::before { content: ""; position: absolute; left: -20px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--blue)); border: 2px solid #FFFFFF; box-shadow: 0 0 0 1px var(--line); }
.as-ev .when { font-size: 12px; } .as-ev .what { font-size: 12.5px; white-space: normal; } .as-ev .what small { display: block; color: var(--muted); }
.as-day { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 6px 0 -2px -22px; }

@media (max-width: 1100px) {
    .as-env, .as-sources { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .as-row, .as-row.icp, .as-trace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .as-env, .as-sources, .as-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .as-ev { grid-template-columns: minmax(0, 1fr); }
    .as-filters .as-input[type=search] { width: 100%; }
}
