/* deal-sheet.css — Pipeline "Sheet" view (rapid inline editing grid).
 * ds- prefix; lives inside .pipeline-sheet-wrap (display:flex set by
 * pipeline.js renderActiveView). Mobile = horizontal scroll, no collapse. */

.pipeline-sheet-wrap {
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 10px;
}

/* ── field picker chips ── */
.ds-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.ds-chip {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12.5px;
    color: #4b5563;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}
.ds-chip:hover { border-color: #9ca3af; }
.ds-chip[aria-pressed="true"] {
    background: #eef2ff;
    border-color: #4f46e5;
    color: #4f46e5;
    font-weight: 600;
}

/* ── grid shell ── */
.ds-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
.ds-grid {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: 13.5px;
}
.ds-grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f9fafb;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    white-space: nowrap;
}
.ds-grid td {
    border-bottom: 1px solid #f1f3f5;
    padding: 3px 6px;
    background: #fff;
    vertical-align: middle;
}
.ds-grid th.ds-hint { text-transform: none; font-weight: 400; color: #9ca3af; }
.ds-empty { padding: 24px; color: #6b7280; text-align: center; }

/* sticky anchor column (deal title) */
.ds-grid th.ds-anchor,
.ds-grid td.ds-anchor {
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 1px solid #e5e7eb;
    min-width: 180px;
    max-width: 260px;
}
.ds-grid th.ds-anchor { z-index: 4; }
.ds-grid td.ds-anchor { background: #fcfcfd; padding: 6px 10px; }
.ds-title {
    display: block;
    color: #1f2937;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ds-title:hover { color: #4f46e5; text-decoration: underline; }

/* ── editors ── */
.ds-cell .ds-ed,
.ds-cell .ds-note-input {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    padding: 5px 6px;
    font: inherit;
    color: #1f2937;
    box-sizing: border-box;
}
.ds-cell:hover .ds-ed,
.ds-cell:hover .ds-note-input { border-color: #e5e7eb; }
.ds-cell .ds-ed:focus,
.ds-cell .ds-note-input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}
.ds-cell select.ds-ed { cursor: pointer; }

/* per-type widths */
.ds-cell-text { min-width: 200px; }
.ds-cell-number { min-width: 96px; max-width: 130px; }
.ds-cell-date { min-width: 150px; }
.ds-cell-select { min-width: 140px; }
.ds-cell-org { min-width: 210px; }
.ds-cell-note { min-width: 280px; max-width: 380px; }

/* OrgPicker embedded in a cell: flatten the form-input chrome to match */
.ds-cell-org .orgpick-input {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    padding: 5px 6px;
    font: inherit;
    width: 100%;
    box-sizing: border-box;
}
.ds-cell-org:hover .orgpick-input { border-color: #e5e7eb; }
.ds-cell-org .orgpick-input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

/* ── notes cell ── */
.ds-note { display: flex; flex-direction: column; gap: 1px; }
.ds-note-prev {
    font-size: 11.5px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 6px;
    min-height: 14px;
}

/* ── save-state feedback ── */
.ds-saving { opacity: 0.65; }
@keyframes ds-flash-saved {
    0% { background-color: #dcfce7; }
    100% { background-color: transparent; }
}
@keyframes ds-flash-error {
    0% { background-color: #fee2e2; }
    100% { background-color: transparent; }
}
.ds-flash-saved { animation: ds-flash-saved 1s ease-out; }
.ds-flash-error { animation: ds-flash-error 1s ease-out; }

/* ── dead rows (deal deleted server-side mid-session) ── */
.ds-dead td { opacity: 0.45; }
.ds-dead .ds-title { text-decoration: line-through; }
