/* ---- Status chips: ONE colour language for the whole app ---- */
.status-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.chip-draft      { background:#e9ecef; color:#495057; }
.chip-assessor   { background:#cfe2ff; color:#084298; }
.chip-pm         { background:#fff3cd; color:#664d03; }
.chip-cpa        { background:#e2d9f3; color:#432874; }
.chip-completed  { background:#d1e7dd; color:#0f5132; }
.chip-pending    { background:#fff3cd; color:#664d03; }
.chip-done       { background:#cfe2ff; color:#084298; }
.chip-verified   { background:#d1e7dd; color:#0f5132; }
.chip-default    { background:#e9ecef; color:#495057; }

/* ---- Dashboard summary cards ---- */
.summary-card { border-left: 4px solid #0d6efd; }
.summary-card .display-6 { font-weight: 700; }

/* ---- Wizard step indicator ---- */
.wizard-steps { display:flex; gap:0; margin-bottom:1.25rem; flex-wrap:wrap; }
.wizard-step {
    flex:1; min-width:140px; text-align:center; padding:8px 6px;
    background:#f1f3f5; color:#868e96; font-size:.85rem; font-weight:600;
    border-right:2px solid #fff; position:relative;
}
.wizard-step.active  { background:#0d6efd; color:#fff; }
.wizard-step.done    { background:#d1e7dd; color:#0f5132; }
.wizard-step:first-child { border-radius:6px 0 0 6px; }
.wizard-step:last-child  { border-radius:0 6px 6px 0; border-right:none; }

/* ---- Criteria sidebar (wizard step 3 / control workspace) ---- */
.side-list { max-height: 75vh; overflow-y:auto; position:relative; }
.side-list .list-group-item { cursor:pointer; padding:.45rem .75rem; font-size:.85rem; }
.side-list .list-group-item.active { background:#0d6efd; border-color:#0d6efd; }
.count-badge { font-size:.7rem; }

/* ---- Control rows in checklist sections ---- */
.control-row { display:flex; gap:.5rem; align-items:flex-start; padding:.4rem .25rem; border-bottom:1px solid #f1f3f5; }
.control-row:hover { background:#f8f9fa; }
.control-row .control-text { white-space:pre-wrap; font-size:.9rem; flex:1; }

/* ---- Tables ---- */
.table-sm td, .table-sm th { vertical-align: middle; }
.count-link { text-decoration:none; font-weight:600; }

/* ---- Control workspace (Phase 3+) ---- */
.status-dot {
    display:inline-block; width:10px; height:10px; border-radius:50%;
    margin-right:4px; vertical-align:baseline;
}
.dot-pending  { background:#ffc107; }
.dot-done     { background:#0d6efd; }
.dot-verified { background:#198754; }

.control-list-item { display:flex; gap:.4rem; align-items:baseline; font-size:.82rem; }
.control-list-item .cl-code { font-weight:600; white-space:nowrap; }
.control-list-item .cl-text { flex:1; color:#6c757d; }
.control-list-item.active .cl-text { color:#fff; }

.test-grid td { vertical-align:top; }
.test-grid textarea:disabled { background:#f1f3f5; }

/* unsaved-changes banner */
.unsaved-banner {
    display:none; position:fixed; bottom:0; left:0; right:0; z-index:1070;
    background:#fff3cd; color:#664d03; border-top:2px solid #ffc107;
    text-align:center; padding:6px; font-weight:600; font-size:.9rem;
}
.unsaved-banner.show { display:block; }

/* historical-data page (opens in its own tab) */
.hist-list { max-height:200px; overflow-y:auto; border:1px solid #eee; }
.htmx-indicator { display:none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display:block; }

/* ---- Misc ---- */
.breadcrumb-bar .breadcrumb-item a { text-decoration:none; }
textarea.autogrow { overflow:hidden; resize:none; }
.required::after { content:" *"; color:#dc3545; }

/* ---- Workspace UI enhancements (31 Oct 2026) ---- */
/* (b) search summary under the search box */
.search-summary { color:#495057; }

/* (c) hide / show the control list. When hidden the main panel takes the
   full width. The arrow button shows ◀ while the list is visible, ▶ when hidden. */
.side-toggle { padding:.15rem .45rem; line-height:1.2; }
.side-toggle .when-hidden { display:none; }
#wsRow.side-hidden .side-toggle .when-shown  { display:none; }
#wsRow.side-hidden .side-toggle .when-hidden { display:inline; }
#wsRow.side-hidden #wsSide { display:none; }
#wsRow.side-hidden #wsMain { flex:0 0 100%; max-width:100%; width:100%; }

/* (d) resizable table columns (drag the right edge of a header cell) */
table.resizable-table { table-layout:fixed; width:100%; }
table.resizable-table th { position:relative; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
table.resizable-table td { overflow-wrap:anywhere; }
.col-resizer {
    position:absolute; top:0; right:0; width:8px; height:100%;
    cursor:col-resize; user-select:none; touch-action:none; z-index:2;
}
.col-resizer::after {
    content:""; position:absolute; top:20%; bottom:20%; right:3px;
    border-right:2px solid #adb5bd;
}
.col-resizer:hover::after, .col-resizer.dragging::after { border-right-color:#0d6efd; top:0; bottom:0; }
body.col-resizing { cursor:col-resize; user-select:none; }
