/* ═══════════════════════════════════════════════════════════════════
   Client Forms — the dashboard bento card painted by
   js/client-intake-card.js.

   Its own file rather than a block in css/dashboard.css for the same
   reason the JS is its own module: the card ships as one self-contained
   unit (markup slot + module + styles) and nothing in the dashboard's own
   render path knows about it.

   The card reuses .widget-card / .widget-header / .widget-title /
   .widget-action / .widget-empty from css/dashboard.css — only the grid
   placement and the .cif-* internals live here. Dark mode is
   `body.dark-mode .class` (never [data-theme]); every colour is a token.
   ═══════════════════════════════════════════════════════════════════ */

.widget-client-forms {
    grid-column: span 4;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Severity accent, same vocabulary as .widget-compliance. `neutral` is the
   not-loaded accent and is the value in the markup, so a card that has never
   answered can never open wearing the green all-clear. */
.widget-client-forms.severity-ok {
    border-left: 4px solid var(--success);
}
.widget-client-forms.severity-warning {
    border-left: 4px solid #FFB340;
}
.widget-client-forms.severity-critical {
    border-left: 4px solid var(--danger);
}
.widget-client-forms.severity-neutral {
    border-left: 4px solid var(--border);
}

/* ── Stat pills ── */
.cif-stats {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.cif-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 5px 6px;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    flex: 1;
    min-width: 0;
    text-align: center;
}
.cif-stat .stat-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
}
.cif-stat .stat-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cif-stat.stat-warning {
    background: rgba(255, 149, 0, 0.10);
}
.cif-stat.stat-warning .stat-count {
    color: var(--warning);
}

/* ── Rows ── */
.cif-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}
.cif-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 6px;
    border: none;
    border-radius: 8px;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}
.cif-row:hover {
    background: var(--bg-input);
}
.cif-row:focus-visible {
    outline: 2px solid var(--apple-blue);
    outline-offset: -2px;
}
.cif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
/* Waiting on the agent vs waiting on the client — the one distinction the
   card exists to draw, so it is carried by colour as well as by order. */
.cif-dot-waiting { background: var(--warning); }
.cif-dot-out     { background: var(--apple-blue); }

.cif-row-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.cif-row-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cif-row:hover .cif-row-title {
    color: var(--apple-blue);
}
.cif-row-meta {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cif-row-tail {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Chips ── */
.cif-tag,
.cif-chip {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 5px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    white-space: nowrap;
}
.cif-chip-warn {
    background: rgba(255, 149, 0, 0.12);
    border-color: rgba(255, 149, 0, 0.30);
    color: var(--warning);
}
.cif-chip-danger {
    background: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.30);
    color: var(--danger);
}

/* ── Notes ── */
.cif-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 0;
    line-height: 1.45;
}
.cif-empty {
    color: var(--text-tertiary);
}
.cif-stale {
    margin-top: 8px;
    font-size: 11px;
    color: var(--warning);
}
.cif-more {
    align-self: flex-start;
    margin-top: 6px;
    padding: 0;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--apple-blue);
    cursor: pointer;
}
.cif-more:hover {
    opacity: 0.8;
}

body.dark-mode .cif-stat,
body.dark-mode .cif-tag,
body.dark-mode .cif-chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
}
body.dark-mode .cif-row:hover {
    background: rgba(255, 255, 255, 0.05);
}
body.dark-mode .cif-chip-warn {
    background: rgba(255, 159, 10, 0.14);
    border-color: rgba(255, 159, 10, 0.32);
}
body.dark-mode .cif-chip-danger {
    background: rgba(255, 69, 58, 0.14);
    border-color: rgba(255, 69, 58, 0.32);
}

/* Responsive — the two blocks in css/dashboard.css that every other widget
   appears in. A-456: .widget-today was the one card missing from these and it
   kept asking for 8 columns in a 2-column grid, so the placement is declared
   here for every breakpoint rather than left to the base rule. */
@media (min-width: 1024px) and (max-width: 1279px) {
    .widget-client-forms {
        grid-column: span 4;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .widget-client-forms {
        grid-column: span 1;
        grid-row: span 2;
    }
}
@media (max-width: 767px) {
    .widget-client-forms {
        grid-column: span 1;
        grid-row: span 1;
    }
    .cif-list {
        max-height: 200px;
    }
}
