/* screens-jobs.css -- Today and Jobs screens. Tokens only. */

/* Today: stat tiles */
.today-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-6); }
.today-stat { display: grid; gap: var(--space-1); padding: var(--space-3); color: var(--text); text-decoration: none; align-content: start; }
.today-stat__num { font-size: var(--fs-xl); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.today-stat__note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-stat .label { font-size: var(--fs-xs); }
@media (max-width: 480px) { .today-stat__num { font-size: var(--fs-lg); } }

/* Lists */
.today-needs, .today-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.today-needs li, .today-jobs li { margin: 0; }
.today-row__ic { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); flex: none; }
.today-follow { flex-wrap: wrap; }
.today-follow__ctl { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
.today-late { color: var(--danger); }
.link-plain { color: inherit; text-decoration: none; }

/* Job cards */
.today-job { position: relative; display: grid; gap: var(--space-2); padding: 0; overflow: hidden; }
.today-job__main { display: grid; gap: var(--space-2); padding: var(--space-4); padding-right: 4.5rem; color: var(--text); text-decoration: none; }
.today-job__name { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.today-job__chips { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.today-cam { position: absolute; top: var(--space-3); right: var(--space-3); display: grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: var(--radius-pill); background: var(--accent-fill); color: var(--on-accent); cursor: pointer; }
.today-cam:active { transform: scale(0.94); }
a.today-job__main:hover { border-color: var(--border-strong); }
.jobs .today-job__main.card { padding-right: var(--space-4); }
.job-progress { display: block; height: 4px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.job-progress > span { display: block; height: 100%; width: 100%; background: var(--accent-fill); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform var(--dur-slow) var(--ease-out); }

/* Jobs page */
.jobs-filter { margin-bottom: var(--space-4); }
.jobs-filter .segmented { width: 100%; }

/* Loading skeletons */
.today-skel { display: grid; gap: var(--space-4); }
.today-skel__tile { height: 4.5rem; border-radius: var(--radius-md); }
.today-skel__row { height: 3.5rem; border-radius: var(--radius-md); }
.today-skel__card { height: 6rem; border-radius: var(--radius-lg); }

@media (prefers-reduced-motion: reduce) { .job-progress > span { transition: none; } .today-cam:active { transform: none; } }

/* Job detail */
.job { display: grid; gap: var(--space-5); }
.job-contact:empty { display: none; }
.job-stagecard { display: grid; gap: var(--space-4); }
.job-stagecard__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.job-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.job-stage { display: flex; align-items: center; gap: var(--space-3); color: var(--text-3); font-size: var(--fs-sm); }
.job-stage__dot { display: grid; place-items: center; width: 1.125rem; height: 1.125rem; border-radius: var(--radius-pill); border: 2px solid var(--border-strong); flex: none; }
.job-stage--done { color: var(--text-2); }
.job-stage--done .job-stage__dot { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.job-stage--current { color: var(--text); font-weight: var(--fw-semibold); }
.job-stage--current .job-stage__dot { border-color: var(--accent-fill); box-shadow: 0 0 0 3px var(--accent-tint); }
.job-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.job-actions > * { flex: 1 1 9rem; justify-content: center; }
.job-composer .hstack { gap: var(--space-2); }

/* Activity feed */
.feed { display: grid; gap: var(--space-5); }
.feed-day__h { margin: 0 0 var(--space-3); color: var(--text-2); }
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.feed-item { display: grid; gap: var(--space-2); padding: var(--space-3); background: var(--surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); }
.feed-item--photo { padding: 0; overflow: hidden; }
.feed-item--photo > :not(.feed-photo) { margin-inline: var(--space-3); }
.feed-item--photo > .fine { padding-bottom: var(--space-3); }
.feed-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.feed-caption, .feed-text { margin: 0; overflow-wrap: anywhere; }
.feed-item--stage { grid-auto-flow: column; justify-content: start; align-items: center; gap: var(--space-2); color: var(--text-2); }
.feed-item--client { border-color: var(--accent-fill); background: var(--accent-tint); }
.feed-item--private { border-style: dashed; background: var(--surface-2); }

/* Leads pipeline */
.pipe-tabs { display: flex; gap: var(--space-2); overflow-x: auto; margin-bottom: var(--space-4); scrollbar-width: none; }
.pipe-tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--tap); padding-inline: var(--space-4); border: var(--border-w) solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-2); font: inherit; cursor: pointer; }
.pipe-tab[aria-selected="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.pipe-tab__n { font-size: var(--fs-sm); opacity: 0.8; }
.pipe-cols { display: grid; gap: var(--space-4); }
.pipe-col { display: none; }
.pipe-col.is-tab { display: block; }
.pipe-col__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-3); }
.pipe-col__head h2 { margin: 0; color: var(--text-2); }
.pipe-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.pipe-card { display: grid; gap: var(--space-2); width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.pipe-card:hover { border-color: var(--border-strong); }
.pipe-card__title { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.pipe-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.pipe-empty { padding: var(--space-4); border: var(--border-w) dashed var(--border); border-radius: var(--radius-md); text-align: center; }
@media (min-width: 62rem) {
  .pipe-tabs { display: none; }
  .pipe-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
  .pipe-col { display: block; }
}

/* Messages (thread styles shared with the client page) */
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.thread__day { text-align: center; color: var(--text-3); margin: var(--space-3) 0 var(--space-1); }
.bubble { max-width: 82%; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); font-size: var(--fs-base); }
.bubble--them { background: var(--surface-2); border-bottom-left-radius: var(--radius-xs); justify-self: start; }
.bubble--me { background: var(--accent-tint); border-bottom-right-radius: var(--radius-xs); justify-self: end; }
.bubble__meta { display: block; margin-top: var(--space-1); font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.msg-row { text-decoration: none; }
.msg-compose { margin-top: var(--space-5); }
body[data-shell="app"] .bubble--me { background: var(--accent-fill); color: var(--on-accent); }
body[data-shell="app"] .bubble--me .bubble__meta { color: var(--on-accent); opacity: 0.8; }

/* Phones: follow-up rows put their controls under the title; stat tiles never clip */
.today-follow .list-row__main { flex: 1 1 10rem; }
.today-follow__ctl { flex: 0 0 auto; }
@media (max-width: 30rem) {
  .today-follow__ctl { width: 100%; margin-left: 0; justify-content: space-between; padding-left: calc(2.25rem + var(--space-3)); }
  .today-stat { padding: var(--space-3) var(--space-2); }
  .today-stat .label { overflow-wrap: anywhere; }
}

/* Sent messages */
.out-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.out-card { display: grid; gap: var(--space-3); }
.out-card__top { display: flex; align-items: flex-start; gap: var(--space-3); }
.out-card__ic { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); flex: none; }
.out-card__who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.out-card__title { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.out-card__skip { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.out-card__details summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-sm); min-height: var(--tap); display: flex; align-items: center; }
.out-card__text { margin: var(--space-2) 0 0; padding: var(--space-3); background: var(--surface-2); border-radius: var(--radius-md); font: inherit; font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Per-stage photo button */
.job-stage { flex-wrap: wrap; }
.job-stage__add { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap); padding-inline: var(--space-3); border: var(--border-w) solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.job-stage__add:hover { border-color: var(--accent-fill); }

/* Edit stages sheet */
.stg { display: grid; gap: var(--space-4); }
.stg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.stg-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); align-items: center; padding: var(--space-3); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.stg-row--current { border-color: var(--accent-fill); }
.stg-row__n { color: var(--text-3); width: 1.25rem; text-align: center; }
.stg-row .field { margin: 0; min-width: 0; }
.stg-row__ctl { grid-column: 2 / -1; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.stg-add { display: grid; gap: var(--space-3); }
.stg-note { margin: 0; }
.job-stagecard__top { flex-wrap: wrap; }

/* Payment schedule */
.sched { display: grid; gap: var(--space-4); }
.sched-intro { margin: 0; }
.sched-total { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; }
.sched-total .field { margin: 0; }
.sched-total .btn-like, .sched-total button { margin-top: var(--space-3); }
.sched-sum { margin: 0; font-weight: var(--fw-semibold); }
.sched-warn { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--text-2); }
.sched-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.sched-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); align-items: center; padding: var(--space-3); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.sched-row__main { display: grid; gap: 2px; min-width: 0; }
.sched-row__title { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.sched-row__ctl { grid-column: 1 / -1; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.sched-link { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; }
.sched-empty { margin: 0; padding: var(--space-3); border: var(--border-w) dashed var(--border); border-radius: var(--radius-md); text-align: center; }
.sched-add { padding-top: var(--space-4); border-top: var(--border-w) solid var(--border); }
.sched-quick { display: grid; gap: var(--space-2); }
.sched-quick .label { margin: 0; color: var(--text-2); }

/* Phones: the job action buttons each get their own row so labels never clip */
@media (max-width: 30rem) { .job-actions > * { flex: 1 1 100%; } }
.sched-bar { display: flex; height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; position: relative; }
.sched-bar__billed { position: absolute; inset: 0 auto 0 0; background: var(--accent-tint); }
.sched-bar__paid { position: absolute; inset: 0 auto 0 0; background: var(--accent-fill); }
.sched-flow { margin: 0; color: var(--text-2); }
.sched-hint { margin: 0; }

/* Phones: the follow-up title link is a full-size tap target */
.today-follow .list-row__title.link-plain { display: inline-flex; align-items: center; min-height: var(--tap); }
