/*
 * Coordinator strips on the worklists: URGENT NOW (#urgentStrip) and the exam-flag TO DO list (#flagStrip).
 * Shared by worklist.html and worklist-outpatient.html. Markup comes from js/coordinator-worklist.js
 * (renderUrgentStrip) and js/exam-flags.js (renderStrip). Theme tokens (--ap-*) come from the app theme.
 */
.urgent-strip, .flag-strip {
    --cs-tone: #b7791f;
    margin: 0 0 12px;
    background: var(--ap-surface);
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-md, 10px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    color: var(--ap-text-primary);
    overflow: hidden;
}
.urgent-strip { --cs-tone: #e5484d; }

/* header */
.urgent-strip-title, .flag-strip-title {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--ap-text-primary);
    background: color-mix(in srgb, var(--cs-tone) 7%, transparent);
    border-bottom: 1px solid var(--ap-border);
}
.cs-dot {
    width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: var(--cs-tone);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cs-tone) 25%, transparent);
}
.cs-count {
    min-width: 22px; padding: 1px 8px; border-radius: 999px; text-align: center;
    font-size: 12px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums;
    color: var(--cs-tone); background: color-mix(in srgb, var(--cs-tone) 16%, transparent);
}
.cs-spacer { flex: 1; }
.flag-strip-title .flag-sound-btn { text-transform: none; letter-spacing: 0; font-weight: 600; }
.flag-sound-btn .bi { margin-right: 4px; }

/* rows */
.urgent-strip-row, .flag-strip-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
    padding: 10px 14px;
    font-size: 13px;
    border-top: 1px solid var(--ap-border);
    transition: background-color .15s;
}
.urgent-strip-title + .urgent-strip-row, .flag-strip-title + .flag-strip-row { border-top: 0; }
.urgent-strip-row:hover, .flag-strip-row:hover { background: var(--ap-table-row-hover, color-mix(in srgb, var(--ap-text-primary) 4%, transparent)); }
.urgent-strip-main, .flag-strip-main { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cs-line1 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.cs-name { font-weight: 700; font-size: 14px; color: var(--ap-text-primary); }
.cs-sub, .urgent-strip-meta, .flag-strip-meta { font-size: 12px; color: var(--ap-text-secondary); }
.cs-sub .cs-sep { opacity: .5; margin: 0 5px; }
.cs-note { font-style: italic; color: var(--ap-text-primary); }
.urgent-not-messaged { color: #e5484d; font-weight: 600; font-style: normal; }

/* reason and age pills */
.flag-strip-reason, .flag-age-tag, .cs-tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.flag-strip-reason {
    color: var(--ap-text-primary);
    background: color-mix(in srgb, #b7791f 16%, transparent);
    border: 1px solid color-mix(in srgb, #b7791f 40%, transparent);
}
.flag-strip-reason::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #b7791f; }
.flag-age-tag { color: #fff; }
.flag-age-late { background: #e5484d; }
.flag-age-stale { background: var(--ap-accent); color: var(--ap-on-accent, #fff); }

/* overdue rows: soft tint only */
.flag-row-late { background: color-mix(in srgb, #e5484d 8%, transparent); }
.flag-row-stale { background: color-mix(in srgb, var(--ap-accent) 7%, transparent); }
.flag-row-late:hover { background: color-mix(in srgb, #e5484d 12%, transparent); }
.flag-row-stale:hover { background: color-mix(in srgb, var(--ap-accent) 11%, transparent); }

/* actions */
.urgent-strip .coord-actions, .flag-strip .coord-actions, .cq-card .coord-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.urgent-strip .coord-btn, .flag-strip .coord-btn, .cq-card .coord-btn {
    display: inline-flex; align-items: center; height: 28px; padding: 0 11px;
    border-radius: 7px; font-size: 12px; font-weight: 600; text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s;
}
.flag-strip .coord-btn-primary:hover:not(:disabled), .cq-card .coord-btn-primary:hover:not(:disabled) { filter: brightness(1.1); background: var(--ap-accent); }
.flag-strip .flag-reply-input, .cq-card .flag-reply-input {
    height: 28px; width: 210px; padding: 0 10px; font-size: 12px; border-radius: 7px;
    border: 1px solid var(--ap-border); background: var(--ap-surface-2, var(--ap-surface)); color: var(--ap-text-primary);
}
.flag-strip .flag-reply-input:focus, .cq-card .flag-reply-input:focus { outline: none; border-color: var(--ap-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ap-accent) 22%, transparent); }
.flag-claim-tag {
    display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 7px;
    font-size: 12px; font-weight: 600; color: var(--ap-accent);
    background: color-mix(in srgb, var(--ap-accent) 12%, transparent);
}
.flag-claim-mine { color: #2f9e6b; background: color-mix(in srgb, #2f9e6b 14%, transparent); }

/* new-request popup (coordinator, top right) */
.flag-popup {
    background: var(--ap-surface); color: var(--ap-text-primary);
    border: 1px solid var(--ap-border); border-radius: 12px;
    padding: 12px 14px; font-size: 13px; cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    animation: csPopIn .2s ease-out;
}
.flag-popup-kicker { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #b7791f; }
.flag-popup-kicker .cs-dot { --cs-tone: #b7791f; }
.flag-popup-title { font-size: 15px; font-weight: 700; margin: 4px 0 2px; }
.flag-popup-sub { color: var(--ap-text-secondary); font-size: 12px; }
@keyframes csPopIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* hidden-hospitals bar under the worklist filters (worklist.html, worklist-outpatient.html)
   One quiet, bordered "filter summary" group: label + count | site tags | Show all. */
#hiddenHospitalsBar {
    display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-top: 10px; padding: 4px 4px 4px 10px; max-width: 100%;
    border: 1px solid var(--ap-border); border-radius: 8px;
    background: var(--ap-surface-2, var(--ap-surface));
    font-size: 12px; line-height: 1;
}
.hidden-hospitals-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 600; color: var(--ap-text-secondary); white-space: nowrap;
}
.hidden-hospitals-label .bi { font-size: 13px; }
.hidden-hospitals-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--ap-text-secondary);
    background: color-mix(in srgb, var(--ap-text-primary) 9%, transparent);
}
.hidden-hospitals-chips { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#hiddenHospitalsBar .hidden-hospital-chip {
    display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 2px 0 8px;
    border-radius: 6px; font-size: 12px; font-weight: 500;
    color: var(--ap-text-primary); background: var(--ap-surface);
    border: 1px solid var(--ap-border);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}
#hiddenHospitalsBar .hidden-hospital-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hiddenHospitalsBar .hidden-hospital-chip button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 4px; border: 0; padding: 0;
    font-size: 15px; line-height: 1; cursor: pointer;
    color: var(--ap-text-secondary); background: transparent;
    transition: background-color .15s, color .15s;
}
#hiddenHospitalsBar .hidden-hospital-chip button:hover { color: var(--ap-text-primary); background: color-mix(in srgb, var(--ap-text-primary) 10%, transparent); }
#hiddenHospitalsBar .hidden-hospital-chip button:focus-visible,
.hidden-show-all:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--ap-accent) 40%, transparent); }
.hidden-show-all {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px; margin: 0;
    border: 0; border-left: 1px solid var(--ap-border); border-radius: 0 6px 6px 0;
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    color: var(--ap-accent); background: transparent;
    transition: background-color .15s, color .15s;
}
.hidden-show-all:hover { background: color-mix(in srgb, var(--ap-accent) 10%, transparent); }

/* Main / Outpatient segmented switch beside the worklist title (extension's
   segmented tabs): rounded track, raised active pill, a dot per list. */
.worklist-title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.worklist-title-row .worklist-title { margin-bottom: 0; }
.worklist-switch {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px;
    border-radius: 9px; border: 1px solid var(--ap-border);
    background: var(--ap-surface-2, var(--ap-bg));
}
.worklist-switch[hidden] { display: none; }
.worklist-switch .ws-tab {
    display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px;
    border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none;
    color: var(--ap-text-secondary); transition: background-color .15s, color .15s, box-shadow .15s;
}
.worklist-switch .ws-tab:hover { color: var(--ap-text-primary); background: color-mix(in srgb, var(--ap-text-primary) 6%, transparent); }
.worklist-switch .ws-tab.is-active {
    color: var(--ap-text-primary); background: var(--ap-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .10), 0 0 0 1px var(--ap-border);
}
.worklist-switch .ws-tab:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--ap-accent) 45%, transparent); }
.worklist-switch .ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ap-accent); opacity: .55; }
.worklist-switch .ws-out .ws-dot { background: var(--ap-warning); }
.worklist-switch .ws-tab.is-active .ws-dot { opacity: 1; }

/* cards in the coordinator side queue (js/coord-queue.js) reuse the row styles; the column is narrow, so the text takes a full line and the buttons wrap under it */
.cq-card .urgent-strip-main, .cq-card .flag-strip-main { flex-basis: 100%; }
.cq-card .coord-actions { flex-wrap: wrap; width: 100%; }
.cq-card .flag-reply-input { flex: 1 1 100%; min-width: 0; }
.cq-card-done { opacity: .75; }
