/* Orders (views/orders.js): the cash-on-delivery work panel on the order page, the call log, the
   call-back picker and the assign dialog. Tokens come from app.css. */

.order-work { gap: 12px; }
.order-work .work-head { gap: 8px 12px; }
.order-work .call-phones { margin-top: 0; }
.order-work .call-phones .phone-call { font-size: 16px; font-weight: 600; }
.order-work .work-more { gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.order-work .next-call { gap: 8px 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.order-work .label-line { gap: 8px; }
.order-work .label-line > i.ok { color: var(--good-ink); }
.order-work .label-line > i.muted { color: var(--muted); }
.order-work .label-line .btn { margin-inline-start: auto; }
.order-work .add-tracking { gap: 8px; align-items: flex-start; }
.order-work .add-tracking .field { min-width: 160px; }

/* Outcome buttons: a wrapping grid that stays tappable on phones. */
.call-panel { display: flex; flex-direction: column; gap: 10px; }
.call-outcomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.call-outcomes .btn { justify-content: flex-start; min-height: 38px; }
.call-outcomes .btn.primary { grid-column: 1 / -1; justify-content: center; min-height: 42px; font-weight: 650; }
.cb-picker { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.cb-picker[hidden] { display: none; }
.cb-presets, .cb-custom { gap: 6px 8px; }
.cb-custom .input { flex: 1 1 200px; min-width: 0; }

details.call-more { border-top: 1px dashed var(--line-strong); padding-top: 10px; }
details.call-more > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); list-style: none; }
details.call-more > summary::-webkit-details-marker { display: none; }
details.call-more > summary::after { content: "▾"; font-size: 11px; color: var(--muted); }
details.call-more[open] > summary { margin-bottom: 10px; }
details.call-more[open] > summary::after { content: "▴"; }

.call-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.call-log li { display: flex; flex-direction: column; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.call-log li:last-child { border-bottom: 0; padding-bottom: 0; }
.call-log .row { gap: 6px 10px; }
.call-none { margin: 0; }

:is(.drawer, .rec-page) .assignee { gap: 4px 8px; align-items: center; }
:is(.drawer, .rec-page) .note-save { justify-content: flex-end; margin-top: 6px; }
.timeline .tl-call { gap: 6px; }
.timeline li.tl-call::before, .timeline li.tl-assign::before, .timeline li.tl-label::before, .timeline li.tl-tracking::before { background: var(--line-strong); }

/* Assign dialog */
.assign-list { display: flex; flex-direction: column; gap: 2px; max-height: min(50vh, 360px); overflow: auto; margin-top: 8px; }
.assign-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.assign-opt:hover { background: var(--surface-2); }
.assign-opt:has(input:checked) { background: var(--accent-soft); }
.assign-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.assign-none { width: 26px; text-align: center; color: var(--muted); }

.call-modal .phones { margin: 4px 0 12px; }
.call-modal .phone-call { font-size: 16px; font-weight: 600; }

@media (max-width: 560px) {
  .call-outcomes { grid-template-columns: 1fr 1fr; }
  .order-work .label-line .btn { margin-inline-start: 0; }
}

/* ---- Order cards (views/orders.js): every part of the order page is a card on the page background:
   summary, confirmation, customer, shipping address, notes, items, calls, timeline. ---- */
.rec-page-b.rec-cards { background: transparent; border: 0; padding: 0; gap: 12px; }
.rec-cards > .rec-panel { background: var(--surface); }
.order-cards { align-items: stretch; }
/* two cards side by side while each keeps 340px, else one per row */
.order-cards.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.info-card { display: flex; flex-direction: column; box-shadow: none; }
.info-card-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.info-card-h h3 { font-size: 14px; font-weight: 650; margin: 0; }
.info-card-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.info-card-h .btn.icon { margin-block: -4px; }
.info-card-b { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.info-card-b .card-text { margin: 0; white-space: pre-wrap; }
.items-card .totals-wrap { margin-top: 2px; padding-top: 10px; border-top: 1px dashed var(--line); }
.person-who { display: flex; align-items: center; gap: 12px; min-width: 0; padding-bottom: 2px; }
.person-avatar { width: 44px; height: 44px; font-size: 15px; font-weight: 650; background: var(--accent-soft); color: var(--accent); }
.person-name { font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }

/* One line per holder: icon and label at the start, the value pushed to the far end. */
.info-rows { display: flex; flex-direction: column; gap: 6px; }
/* A value too wide for the line moves to its own line under the label (still at the far end). */
.info-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; min-height: 40px; padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px;
}
.info-row-ico { color: var(--muted); width: 16px; text-align: center; font-size: 13px; flex: none; }
.info-row-k { color: var(--muted); flex: none; white-space: nowrap; }
.info-row-v { margin-inline-start: auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  gap: 4px 8px; text-align: end; overflow-wrap: anywhere; color: var(--ink); }
.info-row .assignee { gap: 6px; }
.addr-lines { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* A phone: the number, then its contact actions grouped in one holder. */
.phone-line { padding-block: 4px; }
.phone-num { font-size: 14.5px; font-weight: 600; letter-spacing: .02em; }
.contact-acts { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.contact-acts .btn.icon.sm { width: 28px; height: 28px; }
.contact-acts .btn.icon.sm:hover { background: var(--surface-3); }
/* each app in its own colour (copy stays ink) */
.contact-acts .btn.contact-act { color: var(--ink-2); }
.contact-acts .btn.contact-act.ca-call, .contact-acts .btn.contact-act.ca-sms { color: var(--accent); }
.contact-acts .btn.contact-act.ca-whatsapp { color: #25d366; }
.contact-acts .btn.contact-act.ca-viber { color: #7360f2; }
.contact-acts .btn.contact-act.ca-telegram { color: #229ed9; }
.order-work .call-phones, .call-modal .phones { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.order-work .call-phones .phone-num, .call-modal .phone-num { font-size: 16px; }
.order-foot { margin: 0; text-align: end; }
@media (max-width: 720px) {  /* phones: the value (and a phone's actions) on its own line under the label */
  .info-row-v { flex-basis: 100%; justify-content: flex-start; text-align: start; }
  .addr-lines { align-items: flex-start; }
}
