/* Jobs as projects: the new-project form, chips and the inbox project panel. */

.jobs-page { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; background: var(--surface); }
.jobs-toolbar { gap: 8px; }
.jobs-search { width: min(320px, 100%); }
@media (max-width: 760px) { .jobs-search { width: 100%; } }
.job-number { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: 0.01em; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: live-pulse 1.8s infinite; display: inline-block; flex: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* -- job page ------------------------------------------------------------------- */

.job-header { align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.job-header-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.job-header-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.job-title-input, .job-title-static { font: 700 18px/1.3 var(--font); letter-spacing: -0.015em; color: var(--text); margin: 0; }
.job-title-input { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; width: 100%; min-width: 0; }
.job-title-input:hover { border-color: var(--border); }
.job-title-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); background: var(--surface); }
.stage-button { gap: 7px; }
.job-viewers { display: flex; }
.job-detail { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; background: var(--bg); }
.job-detail-main { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.job-detail-side { border-left: 1px solid var(--border); background: var(--surface); min-width: 0; }
.job-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.job-side-foot { padding: 12px 14px 24px; }
@media (max-width: 1100px) { .job-detail { grid-template-columns: minmax(0, 1fr); } .job-detail-side { border-left: 0; border-top: 1px solid var(--border); } }
@media (max-width: 860px) { .job-two-col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .job-header { flex-wrap: wrap; }
  .job-header .page-header-actions { width: 100%; justify-content: flex-end; }
  .job-header .page-header-actions .stage-button { width: auto; padding: 0 10px; }
  .job-header .page-header-actions .stage-button .btn-label { display: inline; }
  .job-detail-main { padding: 10px; }
}
.job-notes-static { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--divider); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.card.is-drop-target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }

/* customer picker */
.customer-field { position: relative; }
.customer-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-3); padding: 4px; max-height: 260px; overflow-y: auto; }
.customer-suggest-item { display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: 5px; font-size: 13.5px; }
.customer-suggest-item:hover { background: var(--hover); }
.new-job-specs { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.new-job-specs > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.new-job-specs[open] > summary { margin-bottom: 10px; }

/* operations */
.op-progress { margin: 0 16px; border-radius: 3px; }
.op-list { display: flex; flex-direction: column; padding: 8px 8px 0; container-type: inline-size; }
.op-row { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: var(--radius); min-width: 0; }
.op-row:hover { background: var(--surface-2); }
.op-row.is-done .op-name-input, .op-row.is-done .op-name { text-decoration: line-through; color: var(--text-3); }
.op-status { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-3); flex: none; }
.op-status:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.op-status.is-in_progress { color: var(--blue); }
.op-status.is-done { color: var(--green); }
.op-status:disabled { cursor: default; }
.op-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(100px, 0.9fr) 86px minmax(150px, auto); gap: 6px; align-items: center; }
.op-person { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 12.5px; min-width: 0; text-align: left; }
.op-person:hover { border-color: var(--text-3); }
.op-duration { display: flex; align-items: center; gap: 4px; }
.op-duration .input { width: 60px; }
.op-schedule { justify-content: flex-start; min-width: 0; }
.op-schedule .btn-label { overflow: hidden; text-overflow: ellipsis; }
.op-main { flex: 1; min-width: 0; }
.op-name { font-weight: 600; }
.op-when { white-space: nowrap; }
.op-empty { padding: 10px 12px 4px; font-size: 13px; }
.op-add { display: flex; align-items: center; gap: 6px; padding: 8px 14px 12px; }
.op-add .input { max-width: 320px; }
@container (max-width: 900px) {
  .op-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .op-name-input { grid-column: span 2; }
  .op-schedule { grid-column: span 2; }
  .op-row { align-items: flex-start; }
}
@container (max-width: 520px) {
  .op-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-name-input, .op-schedule { grid-column: span 2; }
}

/* checklist */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.checklist-item { display: flex; align-items: center; gap: 6px; padding: 4px 2px; border-radius: 6px; min-height: 30px; }
.checklist-item .checkbox { flex: 1; min-width: 0; }
.checklist-item.is-done .checkbox-label { color: var(--text-3); text-decoration: line-through; }
.checklist-by { flex: none; }
.checklist-remove { opacity: 0; }
.checklist-item:hover .checklist-remove { opacity: 1; }
@media (hover: none) { .checklist-remove { opacity: 1; } }
.checklist-add { display: flex; gap: 6px; margin-top: 8px; }

/* files */
.job-files { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.job-file { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.job-file.is-proof { border-color: color-mix(in srgb, var(--purple) 45%, var(--border)); background: color-mix(in srgb, var(--purple-soft) 50%, transparent); }
.job-file-thumb { width: 44px; height: 44px; border-radius: 6px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--text-3); flex: none; overflow: hidden; }
.job-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.job-file-info { flex: 1; min-width: 0; }
.job-file-name { display: block; font-weight: 600; font-size: 13px; color: var(--text); }
.proof-toggle { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 11.5px; font-weight: 600; color: var(--text-3); border: 1px dashed var(--border-strong); white-space: nowrap; }
.proof-toggle:hover { color: var(--text); border-color: var(--text-3); }
.proof-toggle.is-on { background: var(--purple-soft); color: var(--purple-text); border: 1px solid transparent; }
.job-files-empty { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; text-align: center; }

/* activity */
.job-activity { display: flex; flex-direction: column; gap: 10px; }
.job-event { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.job-event-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); display: flex; align-items: center; justify-content: center; flex: none; }
.job-event-text { flex: 1; min-width: 0; }
.job-comment { display: flex; gap: 10px; align-items: flex-start; }
.job-comment-main { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--divider); border-radius: 10px; padding: 7px 10px 8px; }
.job-comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.job-comment-body { font-size: 13.5px; margin-top: 2px; }
.job-comment-edit .rich-editor { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; }
.reaction.is-mine { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.job-composer { margin-top: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.job-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.job-composer-actions { display: flex; justify-content: flex-end; padding: 0 8px 8px; }

/* side panels */
.stage-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.stage-steps li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); padding: 2px 0; }
.stage-steps li.is-past { color: var(--text-2); }
.stage-steps li.is-current { color: var(--text); font-weight: 650; }
.stage-step-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; }
.stage-steps li.is-current .stage-step-dot { box-shadow: 0 0 0 3px var(--accent-soft); border-color: transparent; }
.proof-link { display: flex; gap: 4px; }
.linked-conv { display: flex; align-items: center; gap: 6px; padding: 4px 0; min-width: 0; }
.linked-conv-main { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; color: var(--text); font-size: 13px; }
.linked-conv-main .icon { color: var(--text-3); }
.linked-conv-unlink { opacity: 0; }
.linked-conv:hover .linked-conv-unlink { opacity: 1; }
@media (hover: none) { .linked-conv-unlink { opacity: 1; } }
.job-task { display: flex; align-items: center; gap: 6px; padding: 4px 0; color: var(--text); font-size: 13px; }
.job-task .icon { color: var(--text-3); }
.job-task.is-done { color: var(--text-3); text-decoration: line-through; }

/* -- inbox panel & My Day widget ------------------------------------------------ */

.panel-job { display: flex; align-items: flex-start; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--divider); min-width: 0; }
.panel-job:last-of-type { border-bottom: 0; }
.panel-job-main { flex: 1; min-width: 0; color: var(--text); }
.panel-job-main:hover { text-decoration: none; }
.panel-job-main:hover .strong { text-decoration: underline; }
.panel-job-action { opacity: 0.6; }
.panel-job:hover .panel-job-action { opacity: 1; }
.panel-job.is-archived { opacity: 0.6; }
.panel-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.panel-empty p { margin: 0; }
.panel-subhead { margin: 12px 0 2px; font-size: 11px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }

.widget-subhead { font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.widget-step { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--divider); min-width: 0; }
.widget-step:last-child { border-bottom: 0; }
.widget-step-time { width: 58px; flex: none; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.widget-step-main { display: flex; flex-direction: column; min-width: 0; color: var(--text); }
.widget-step.is-done .widget-step-main { opacity: 0.6; }
.widget-step-done { color: var(--green); }
.widget-job { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--divider); color: var(--text); font-size: 13px; min-width: 0; }
.widget-job:last-child { border-bottom: 0; }
.widget-job:hover { text-decoration: none; background: var(--hover); }
