/* ============================================================
   Queue cards — shared by the Inquiry Requests (/inquiries) and
   Client Replies (/follow-up-responses) queues (2026-09-22).

   One flat static card per record: head (title · reference code ·
   flags) → stat strip → requester → note → footer (trace · pill
   actions). No hover (containers never hover), no nested boxes
   (stats and notes are hairline-separated rows, not cards-in-cards),
   pill buttons on the .sds-btn recipe.
   ============================================================ */
.qc-page {
    --brand-green: #198754;
    --brand-green-dark: #146c43;
    --brand-amber: #ffc107;
    --brand-purple: #6f42c1;
    --text-quiet: #8a9199;
    --rule: rgba(0, 0, 0, 0.07);
}
[data-theme="dark"] .qc-page {
    --text-quiet: #79828f;
    --rule: rgba(255, 255, 255, 0.08);
}

/* ---- Queue header (title · count · hint) ---- */
.qc-queue-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin: 0 0 1.15rem; padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--rule);
}
.qc-queue-title {
    display: flex; align-items: center; gap: 0.55rem;
    font-size: 0.82rem; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--text-secondary);
}
.qc-queue-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.55rem; height: 1.55rem; padding: 0 0.45rem;
    border-radius: 999px; background: var(--brand-green); color: #fff;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0;
}
.qc-queue-hint { font-size: 0.8rem; color: var(--text-quiet); }

.qc-stack { display: flex; flex-direction: column; gap: 1rem; }

/* ---- Card shell ---- */
.qc-card {
    display: flex; flex-direction: column; gap: 0.9rem;
    padding: 1.15rem 1.4rem 1rem;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 20, 24, 0.05), 0 6px 14px rgba(16, 20, 24, 0.07);
    color: var(--text-primary);
}
[data-theme="dark"] .qc-card {
    background: #1e2027;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 16px rgba(0, 0, 0, 0.4);
}
/* Time-sensitive record: thin amber cap, nothing else changes. */
.qc-card.is-soon { box-shadow: inset 0 3px 0 0 var(--brand-amber), 0 1px 2px rgba(16, 20, 24, 0.05), 0 6px 14px rgba(16, 20, 24, 0.07); }
[data-theme="dark"] .qc-card.is-soon { box-shadow: inset 0 3px 0 0 var(--brand-amber), 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 16px rgba(0, 0, 0, 0.4); }

/* ---- Head: title (left) · reference code (center) · flags (right) ---- */
.qc-head {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center; gap: 0.75rem 1.25rem;
}
.qc-lead { min-width: 0; }
.qc-title { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--text-primary); overflow-wrap: anywhere; }
.qc-sub { margin: 0.2rem 0 0; font-size: 0.84rem; color: var(--text-secondary); }
.qc-code {
    display: inline-flex; align-items: center; gap: 0.3rem; justify-self: center;
    font-family: inherit; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.1em; line-height: 1; font-variant-numeric: tabular-nums;
    color: var(--brand-purple); white-space: nowrap;
}
.qc-code i { font-size: 1rem; opacity: 0.55; }
[data-theme="dark"] .qc-code { color: #c9aef5; }
/* Inquiry Requests uses a lighter purple for the code (owner preference, 2026-09-22). */
.qc-page.inquiries .qc-code { color: #a98bdf; }
[data-theme="dark"] .qc-page.inquiries .qc-code { color: #d9c9fa; }
.qc-flags { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; flex-wrap: wrap; min-width: 0; }
.qc-flag {
    display: inline-flex; align-items: center; gap: 0.3rem;
    min-height: 26px; padding: 0.22rem 0.65rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap;
    background: rgba(108, 117, 125, 0.12); color: var(--text-secondary);
}
[data-theme="dark"] .qc-flag { background: rgba(255, 255, 255, 0.08); }
.qc-flag.amber { background: rgba(255, 193, 7, 0.22); color: #8a6100; }
[data-theme="dark"] .qc-flag.amber { background: rgba(255, 193, 7, 0.2); color: #ffce3a; }
.qc-flag.purple { background: rgba(111, 66, 193, 0.14); color: var(--brand-purple); }
[data-theme="dark"] .qc-flag.purple { background: rgba(111, 66, 193, 0.3); color: #c9aef5; }
.qc-flag.green { background: rgba(25, 135, 84, 0.13); color: var(--brand-green-dark); }
[data-theme="dark"] .qc-flag.green { background: rgba(25, 135, 84, 0.26); color: #5dd39e; }

/* ---- Stat strip: flat row between two hairlines, evenly spaced ---- */
.qc-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.5rem 1.25rem;
    padding: 0.7rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.qc-stat { min-width: 0; }
.qc-stat-cap { display: block; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-quiet); }
.qc-stat-val {
    display: block; margin-top: 0.15rem;
    font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
    color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Requester / client row ---- */
.qc-person { display: flex; align-items: center; gap: 0.7rem; }
.qc-avatar {
    display: grid; place-items: center; flex-shrink: 0;
    width: 2.3rem; height: 2.3rem; border-radius: 50%;
    background: rgba(25, 135, 84, 0.14); color: var(--brand-green-dark);
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
}
[data-theme="dark"] .qc-avatar { background: rgba(25, 135, 84, 0.26); color: #8ce3bb; }
.qc-person-lines { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.qc-person-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-person-sub { font-size: 0.78rem; color: var(--text-quiet); overflow-wrap: anywhere; }
.qc-person-actions { margin-left: auto; display: flex; gap: 0.35rem; align-items: center; flex-shrink: 0; }
.qc-warn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    min-height: 26px; padding: 0.22rem 0.6rem; border-radius: 999px;
    background: rgba(255, 193, 7, 0.18); color: #8a6100;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
[data-theme="dark"] .qc-warn { background: rgba(255, 193, 7, 0.16); color: #ffce3a; }

/* ---- Note: hairline-quoted, not a box ---- */
.qc-note {
    margin: 0; padding: 0.15rem 0 0.15rem 0.9rem;
    border-left: 2px solid var(--rule);
    font-size: 0.86rem; line-height: 1.5; color: var(--text-secondary); overflow-wrap: anywhere;
}
.qc-note i { margin-right: 0.35rem; opacity: 0.6; }

/* ---- Footer: trace (left) · actions (right, stays right when wrapping) ---- */
.qc-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem 1rem; flex-wrap: wrap;
    padding-top: 0.85rem; border-top: 1px solid var(--rule);
}
.qc-trace { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.45rem; font-size: 0.73rem; color: var(--text-quiet); }
.qc-sep { opacity: 0.45; }
.qc-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex-wrap: wrap; }
.qc-locked { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 32px; font-size: 0.76rem; font-weight: 600; color: var(--text-quiet); }

/* ---- Pill buttons (.sds-btn recipe, card "sm" size: 32px) ---- */
.qc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    min-height: 32px; padding: 0.3rem 0.9rem; border-radius: 999px;
    border: 1px solid var(--rule); background: transparent;
    color: var(--text-secondary); font-family: inherit; font-size: 0.76rem; font-weight: 600; line-height: 1;
    white-space: nowrap; cursor: pointer; text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.qc-btn:hover:not(:disabled) { background: rgba(108, 117, 125, 0.1); color: var(--text-primary); text-decoration: none; }
.qc-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.qc-btn:focus-visible { outline: 2px solid var(--brand-green); outline-offset: 2px; }
.qc-btn.primary { background: rgba(33, 37, 41, 0.92); border-color: transparent; color: #fff; }
.qc-btn.primary:hover:not(:disabled) { background: rgba(33, 37, 41, 1); color: #fff; }
.qc-btn.success { background: rgba(25, 135, 84, 0.92); border-color: transparent; color: #fff; }
.qc-btn.success:hover:not(:disabled) { background: rgba(25, 135, 84, 1); color: #fff; }
.qc-btn.icon { width: 32px; padding: 0; }
.qc-btn.icon i { font-size: 0.85rem; }
[data-theme="dark"] .qc-btn { border-color: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.75); }
[data-theme="dark"] .qc-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: #fff; }
[data-theme="dark"] .qc-btn.primary { background: rgba(255, 255, 255, 0.9); color: #111; }
[data-theme="dark"] .qc-btn.primary:hover:not(:disabled) { background: #fff; color: #111; }
[data-theme="dark"] .qc-btn.success { background: rgba(25, 135, 84, 0.92); color: #fff; }

/* ---- Empty state ---- */
.qc-empty {
    text-align: center; padding: 2.5rem 1.25rem;
    background: #fff; border: 1px solid var(--rule); border-radius: 14px;
    box-shadow: 0 2px 8px rgba(16, 20, 24, 0.06);
}
[data-theme="dark"] .qc-empty { background: #1e2027; }
.qc-empty i { display: block; margin-bottom: 0.5rem; font-size: 2.2rem; color: var(--brand-green); }
[data-theme="dark"] .qc-empty i { color: #5dd39e; }
.qc-empty-title { font-weight: 600; color: var(--text-primary); }
.qc-empty-sub { font-size: 0.9rem; color: var(--text-secondary); }

/* ---- Tablet: head keeps three columns, code shrinks a notch ---- */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .qc-code { font-size: 1.3rem; }
}

/* ---- Mobile: head stacks (title → code → flags), everything left-aligned ---- */
@media (max-width: 767.98px) {
    .qc-page { padding-left: 1rem; padding-right: 1rem; }
    .qc-card { padding: 1rem 1.1rem 0.9rem; gap: 0.8rem; }
    .qc-head { grid-template-columns: 1fr; gap: 0.6rem; }
    .qc-code { justify-self: start; font-size: 1.3rem; }
    .qc-flags { justify-content: flex-start; }
    .qc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qc-person { flex-wrap: wrap; }
    .qc-actions { width: 100%; justify-content: flex-end; }
    .qc-btn { min-height: 30px; padding: 0.25rem 0.75rem; font-size: 0.72rem; }
    .qc-btn.icon { width: 30px; }
}
