/* =============================================================================================
 * cs-inspections.css - the inspection VERDICT vocabulary, app-wide (2026-10-03).
 *
 * Transcribed from `resources\claude-design-project-files\Page View Detail - Works Order
 * Inspections.dc.html`. Rob, 2026-10-03, asked as options: the look lands EVERYWHERE the shared
 * renderers draw - every inspection_results grid (cs_renderLayout_inspectionResultsGrid), every
 * host list's Outcome cell (cs_inspectionChecklist_outcomeCell) and the works-order due-checks
 * panel (cs_inProcess_panelHtml) - so a verdict reads the same wherever a reader meets it.
 *
 * Geometry in px, transcribed from the design file: cornerstone.css sets html{font-size:82%} and
 * shifts the spacing scale one step, so rem and utility classes land ~40-55% small against a
 * design authored at a 16px base. Classes are owned here (`cs-insp-*`) rather than composed from
 * .btn / .badge / .table, which all carry app-wide rules that contradict the design.
 *
 * Loaded on every page from common/layout_head.tpl, versioned by CS_CSS_VERSION (listed in
 * phpgen_settings.php). The popovers are opened by assets/js/cs-inspection-outcome.js.
 * ============================================================================================= */

/* ---- pills: tinted (the cell itself) ------------------------------------------------------- */
.cs-insp-pill {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .02em;
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
    vertical-align: middle;
}
.cs-insp-pill--pass  { color: #02894e; background: #e4faf0; }
.cs-insp-pill--fail  { color: #a51f1f; background: #fbe8e8; }
.cs-insp-pill--warn  { color: #8a5a00; background: var(--cs-amber-100, #fdeccc); }
.cs-insp-pill--info  { color: var(--cs-blue-700, #014fa0); background: var(--cs-blue-50, #eff6fe); }
.cs-insp-pill--muted { color: var(--cs-gray-500, #6b7986); background: var(--cs-gray-100, #eef1f5); }

/* ---- pills: solid (inside a chip, and in the popover) ------------------------------------- */
.cs-insp-pill--solid { color: #fff; font-size: 10px; padding: 3px 8px; }
.cs-insp-pill--solid.cs-insp-pill--pass  { background: #00894e; }
.cs-insp-pill--solid.cs-insp-pill--fail  { background: var(--cs-red, #E13B3B); }
.cs-insp-pill--solid.cs-insp-pill--warn  { background: var(--cs-amber, #F5A623); }
.cs-insp-pill--solid.cs-insp-pill--muted { background: var(--cs-gray-400, #9aa7b4); }

/* ---- score, coloured FROM the verdict (never from a threshold) ---------------------------- */
.cs-insp-score        { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-insp-score--pass  { color: #02894e; }
.cs-insp-score--fail  { color: #a51f1f; }
.cs-insp-score--warn  { color: #8a5a00; }
.cs-insp-score--muted { color: var(--cs-gray-500, #6b7986); }
.cs-insp-dash         { color: var(--cs-gray-400, #9aa7b4); }

/* ---- the summary chip: worst verdict + "N results" + chevron ------------------------------ */
.cs-insp-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    border-radius: 999px;
    padding: 5px 12px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    font-family: inherit;
}
.cs-insp-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(1, 113, 223, .35); }
.cs-insp-chip-count { font-size: 12px; font-weight: 700; }
.cs-insp-chip .lni  { font-size: 11px; }
.cs-insp-chip--pass  { background: #e4faf0; color: #02894e; }
.cs-insp-chip--fail  { background: #fbe8e8; color: #a51f1f; }
.cs-insp-chip--warn  { background: var(--cs-amber-100, #fdeccc); color: #8a5a00; }
.cs-insp-chip--muted { background: var(--cs-gray-100, #eef1f5); color: var(--cs-gray-600, #4d5a66); }
.cs-insp-chip--sm { gap: 6px; padding: 4px 10px; }
.cs-insp-chip--sm .cs-insp-chip-count { font-size: 11.5px; }

/* The popover's content travels with the cell in a <template>, and is cloned to <body> on open so a
   scrolling grid (overflow-x:auto) cannot clip it. */
.cs-insp-pop-src { display: none !important; }

.cs-insp-pop {
    position: fixed;
    z-index: 1060;
    width: 300px;
    max-height: 60vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-subtle, #e1e6ec);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(16, 43, 59, .18);
    padding: 6px;
    text-align: left;
}
.cs-insp-pop-item { padding: 9px 10px; border-bottom: 1px solid var(--cs-gray-100, #eef1f5); }
.cs-insp-pop-item:last-child { border-bottom: none; }
.cs-insp-pop-title {
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cs-gray-500, #6b7986);
    margin-bottom: 6px;
    white-space: normal;
}
.cs-insp-pop-row   { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cs-insp-pop-pills { display: flex; gap: 5px; }
.cs-insp-pop-score { font-size: 11.5px; color: var(--cs-gray-500, #6b7986); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- the works-order due-checks panel ("In-Process Checks Due") --------------------------- */
/* The table carries Bootstrap's .table (Rob, 2026-10-03), whose th/td rules would otherwise
   restyle it - hence `.cs-insp-panel .table.cs-insp-panel-table` on the cell rules below. */
.cs-insp-panel {
    background: #fff;
    border: 1px solid var(--border-subtle, #e1e6ec);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(16, 43, 59, .06);
    overflow: hidden;
    margin: 0 0 20px 0;
}
.cs-insp-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle, #e1e6ec);
}
.cs-insp-panel-title {
    font-family: var(--font-heading, 'Poppins', sans-serif);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-strong, #102B3B);
}
.cs-insp-panel-meta  { font-size: 12.5px; color: var(--cs-gray-500, #6b7986); }
.cs-insp-panel-empty { padding: 16px 20px; font-size: 13px; color: var(--cs-gray-500, #6b7986); }
.cs-insp-panel-scroll { overflow-x: auto; }

.cs-insp-panel .table.cs-insp-panel-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; }
.cs-insp-panel .table.cs-insp-panel-table > thead > tr > th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--cs-gray-500, #6b7986);
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle, #e1e6ec);
    white-space: nowrap;
}
.cs-insp-panel .table.cs-insp-panel-table > tbody > tr > td {
    padding: 14px 12px;
    vertical-align: middle;
    color: var(--cs-gray-600, #4d5a66);
    border-bottom: 1px solid var(--border-subtle, #e1e6ec);
}
.cs-insp-panel .table.cs-insp-panel-table > tbody > tr:last-child > td { border-bottom: none; }
.cs-insp-panel .table.cs-insp-panel-table th:first-child,
.cs-insp-panel .table.cs-insp-panel-table td:first-child { padding-left: 20px; }
.cs-insp-panel .table.cs-insp-panel-table th:last-child,
.cs-insp-panel .table.cs-insp-panel-table td:last-child  { padding-right: 20px; text-align: right; white-space: nowrap; }
.cs-insp-panel .table.cs-insp-panel-table td.cs-insp-panel-check { color: var(--text-strong, #102B3B); max-width: 320px; }
.cs-insp-panel-schedule { max-width: 280px; }
.cs-insp-panel-status   { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-insp-panel-next     { font-size: 12px; color: var(--cs-gray-500, #6b7986); }
.cs-insp-panel-reason   { font-size: 12px; color: #a51f1f; }
.cs-insp-panel-noperm   { font-size: 12px; color: var(--cs-gray-500, #6b7986); }

/* Record now - the design's rounded-rect primary button (8px, not a pill). */
.cs-insp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--cs-blue, #0171DF);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 13px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 120ms ease, transform 120ms ease;
}
.cs-insp-btn:hover  { background: var(--cs-blue-600, #0160c0); color: #fff; }
.cs-insp-btn:active { transform: scale(.97); }
.cs-insp-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(1, 113, 223, .35); }
.cs-insp-btn[disabled] { opacity: .6; cursor: default; }
.cs-insp-btn .lni { font-size: 12px; }
