/* My Deals (redesign Phase 3): cards on phones, the table on desktop, in-place editors for
   the stage and the starting month, and the select-mode bar. Every tap target is at least
   44px tall. Colors come from tokens.css; stage colors from config/stages.json. */

/* The stage and starting month as buttons */
.edit-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: 22px; font: inherit; color: var(--text-strong);
}
.edit-chip:hover { border-color: var(--border); background: var(--panel-2); }
.edit-chip:focus-visible { outline: 2px solid var(--zv-blue); outline-offset: 2px; }
.edit-chip .chev { font-size: 11px; color: var(--muted); }
.start-chip { font-size: 14px; font-weight: 600; color: var(--muted); border-color: var(--border); padding: 0 12px; }
.start-chip.is-past, .start-past { color: var(--zv-red-deep); }
.start-chip.is-past { border-color: #f3b8c3; background: var(--zv-red-wash); }
.inline-edit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inline-edit select { width: auto; min-height: 44px; }
.inline-edit select.year-select { width: 96px; }
.muted { color: var(--muted); }

/* Phone cards */
.deal-cards { list-style: none; display: grid; gap: 10px; }
.deal-card {
  display: flex; gap: 8px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm);
}
.deal-card.is-selected { border-color: var(--zv-blue); box-shadow: 0 0 0 2px var(--zv-blue-wash); }
.dc-body { flex: 1; min-width: 0; }
.dc-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.dc-surgeon { font-size: 17px; font-weight: 700; color: var(--text-bright); overflow-wrap: anywhere; }
.dc-amount { font-size: 15px; color: var(--text-strong); white-space: nowrap; }
.dc-sub { font-size: 15px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.dc-controls { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 8px 0 2px -8px; }
.dc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.dc-foot .edit-btn { min-height: 44px; padding: 0 16px; font-size: 12px; }
.deals-empty { font-size: 16px; letter-spacing: 0; }

/* Desktop table additions */
#dealsTable tr.is-selected td { background: var(--zv-blue-wash); }
#dealsTable td .edit-chip { margin: -6px 0; }
#dealsTable .edit-btn { min-height: 36px; }
.sel-col { width: 52px; }

/* Select mode */
.sel-box {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; margin: -6px 0 -6px -8px; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.sel-box input { width: 22px; height: 22px; margin: 0; accent-color: var(--zv-blue); cursor: pointer; }
.deals-select[aria-pressed="true"] { background: var(--text-bright); border-color: var(--text-bright); color: #fff; }

.bulk-bar {
  position: sticky; bottom: 0; z-index: 55; margin: 16px -24px -24px; padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.08);
}
.bulk-inner { max-width: 1400px; margin: 0 auto; display: grid; gap: 8px; }
.bulk-top { display: flex; align-items: center; gap: 12px; }
.bulk-n { font-size: 16px; font-weight: 700; color: var(--text-bright); margin-right: auto; white-space: nowrap; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bulk-stage { display: inline-flex; gap: 6px; align-items: center; }
.bulk-stage select { width: auto; min-height: 44px; }
.bulk-note { font-size: 14px; color: var(--muted); margin: 0; }
.chip-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.chip-btn:disabled:hover { border-color: var(--border); color: var(--text-strong); }

@media (max-width: 767px) {
  /* Above the phone bottom bar, and the undo message above this bar. */
  .bulk-bar { position: fixed; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); margin: 0; padding: 10px 16px; }
  body.bulk-open .screen.active { padding-bottom: calc(300px + env(safe-area-inset-bottom)); }
  body.bulk-open .undo-toast { bottom: calc(260px + env(safe-area-inset-bottom)); }
  .bulk-stage { flex: 1 1 100%; }
  .bulk-stage select { flex: 1; }
}
