/* Outbox (application/views/order/outbox.php). Loaded after inbox.css, whose tokens and
   components (.inbox-page --c-*, buttons, boxes, tabs) the page shares. */

.ob-paid { margin: 14px 0 0; font-size: 15px; }

.ob-list {
    list-style: none; margin: 14px 0 0; padding: 0;
    background: var(--c-white); border-radius: var(--c-radius);
}
.ob-ship { padding: 18px 20px 16px; border-bottom: 1px solid var(--c-rule); scroll-margin-top: 80px; }
.ob-ship:last-child { border-bottom: 0; }
.ob-ship--compact { padding-block: 14px 12px; }

/* ---------- Head: status, shipment number, facts ---------- */

.ob-ship__head { display: flex; justify-content: space-between; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
.ob-ship__title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; font-size: 17px; font-weight: 500; color: var(--c-dark); }
.ob-ship__id { font-weight: 400; color: var(--c-muted); font-size: 15px; }
.ob-ship__meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; font-size: 14px; color: var(--c-muted); }
.ob-ship__meta > span + span::before { content: '·'; padding-inline: 8px; color: var(--c-rule-strong); }

.ob-status {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px;
    font-size: 15px; font-weight: 500; line-height: 1.5;
}
.ob-status--progress { background: var(--c-purple-soft); color: var(--c-navy); }
.ob-status--attention { background: #FBEADC; color: var(--c-orange); }
.ob-status--problem { background: #FAE5E3; color: var(--c-red); }
.ob-status--done { background: #F1F6D6; color: var(--c-dark); padding-inline-start: 6px; }
.ob-status--stale { background: var(--c-bg-2); color: var(--c-dark); }
.ob-status--ended { background: var(--c-bg-2); color: var(--c-muted); }

/* ---------- What is happening now ---------- */

.ob-ship__now { margin-top: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ob-ship__now p { margin: 0; max-width: 72ch; }
.ob-ship__next { font-size: 15px; color: var(--c-dark); }
.ob-ship--compact .ob-ship__next { font-size: 14px; color: var(--c-muted); }
.ob-ship__latest { font-size: 14px; color: var(--c-navy); }
.ob-ship__latest b { font-weight: 500; }
.ob-ship__eta { font-size: 14px; color: var(--c-dark); }
.ob-ship__eta b { font-weight: 500; }
.ob-ship__eta .inbox-sub { display: inline; margin-inline-start: 6px; }
/* ---------- Tracker ---------- */

.ob-track {
    display: grid; grid-template-columns: repeat(var(--ob-steps, 5), minmax(0, 1fr));
    margin: 18px 0 2px; padding: 0; list-style: none;
}
.ob-track--3 { --ob-steps: 3; }
.ob-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 4px; text-align: center; }
/* Connector from the previous step to this one, drawn behind the dots */
.ob-step::before {
    content: ''; position: absolute; top: 14px; height: 3px; border-radius: 2px;
    inset-inline-start: calc(-50% + 18px); inset-inline-end: calc(50% + 18px);
    background: var(--c-rule);
}
.ob-step:first-child::before { content: none; }
.ob-step:not(.ob-step--upcoming)::before { background: var(--c-purple); }

.ob-step__dot {
    display: grid; place-items: center; flex: none;
    width: 24px; height: 24px; margin: 3px 0;
    border: 2px solid var(--c-rule-strong); border-radius: 50%; background: var(--c-white); color: #fff;
}
.ob-step__dot svg { width: 14px; height: 14px; }
.ob-step--done .ob-step__dot { background: var(--c-purple); border-color: var(--c-purple); }
.ob-step--current .ob-step__dot,
.ob-step--attention .ob-step__dot,
.ob-step--problem .ob-step__dot { width: 30px; height: 30px; margin: 0; }
.ob-step--current .ob-step__dot { background: var(--c-purple); border-color: var(--c-purple); }
.ob-step--current .ob-step__dot svg, .ob-step--attention .ob-step__dot svg, .ob-step--problem .ob-step__dot svg { width: 16px; height: 16px; }
.ob-ship--done .ob-step--current .ob-step__dot { background: var(--c-lime); border-color: var(--c-lime); color: var(--c-dark); }
.ob-step--attention .ob-step__dot { background: var(--c-orange); border-color: var(--c-orange); }
.ob-step--problem .ob-step__dot { background: var(--c-red); border-color: var(--c-red); }

.ob-step__label { font-size: 14px; line-height: 1.3; color: var(--c-dark); }
.ob-step--upcoming .ob-step__label { color: var(--c-muted); }
.ob-step--current .ob-step__label { font-weight: 600; }
.ob-step--attention .ob-step__label { font-weight: 600; color: var(--c-orange); }
.ob-step--problem .ob-step__label { font-weight: 600; color: var(--c-red); }
.ob-step__date { font-size: 13px; color: var(--c-muted); }

/* ---------- Foot: tracking number and actions ---------- */

.ob-ship__foot {
    display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap;
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-rule);
}
.ob-ship--compact .ob-ship__foot { margin-top: 10px; padding-top: 8px; }
.ob-ship__tracking { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; font-size: 14px; }
.ob-ship__label { color: var(--c-muted); }
.ob-ship__actions { display: flex; gap: 8px; margin-inline-start: auto; }

/* ---------- Details ---------- */

.ob-ship__details { margin-top: 12px; padding: 14px 16px; border-radius: var(--c-radius); background: var(--c-bg); }
.ob-ship__details[hidden] { display: none; }
.ob-ship__details > .ob-track { margin: 4px 0 16px; }
.ob-details__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.ob-details__grid--single { grid-template-columns: minmax(0, 1fr); }
.ob-details__section h3 { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: var(--c-dark); }
.ob-details__section + .ob-details__section, .ob-details__grid + .ob-details__section { margin-top: 16px; }
.ob-details__grid > .ob-details__section { margin-top: 0; }

.ob-events { list-style: none; margin: 0; padding: 0; }
/* style.css numbers every ol > li as a table; both outbox lists opt out */
.ob-track > li, .ob-events > li { margin: 0; counter-increment: none; }
.ob-events > li::before { content: none; display: none; }
.ob-events li {
    display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px;
    padding: 6px 0; border-bottom: 1px solid var(--c-rule); font-size: 14px;
}
.ob-events li:last-child { border-bottom: 0; }
.ob-events li:first-child span { font-weight: 500; }
.ob-events time { color: var(--c-muted); }
/* Only the newest event can still need the customer */
.ob-events li:first-child.ob-events--contact span, .ob-events li:first-child.ob-events--failed span, .ob-events li:first-child.ob-events--pickup span { color: var(--c-orange); }
.ob-events li:first-child.ob-events--problem span { color: var(--c-red); }
.ob-address { margin: 0; font-size: 14px; color: var(--c-navy); text-align: left; }

.ob-parcels { width: 100%; border-collapse: collapse; background: var(--c-white); }
.ob-parcels th { padding: 8px; background: var(--c-dark); color: #fff; font-size: 13px; font-weight: 400; text-align: start; }
.ob-parcels td { padding: 8px; border-bottom: 1px solid var(--c-rule); font-size: 14px; text-align: start; }
.ob-parcels tr:last-child td { border-bottom: 0; }
.ob-parcels__track .inbox-ltr { overflow-wrap: anywhere; }
.ob-parcels__track .js-copy { margin-inline-start: 6px; }

/* ---------- Phone ---------- */

@media (max-width: 767.98px) {
    .ob-list { margin-inline: -15px; border-radius: 0; }
    .ob-ship { padding: 14px 15px; }
    .ob-ship__title { gap: 8px; }
    .ob-ship__meta { column-gap: 14px; }
    .ob-ship__meta > span + span::before { content: none; }
    .ob-ship__eta .inbox-sub { display: block; margin: 0; }
    .ob-step { padding: 0 2px; }
    .ob-step__label { font-size: 12.5px; }
    .ob-step__date { font-size: 12px; }
    .ob-step::before { inset-inline-start: calc(-50% + 16px); inset-inline-end: calc(50% + 16px); }
    .ob-ship__actions { margin-inline-start: 0; width: 100%; }
    .ob-ship__actions .inbox-btn { flex: 1; }
    .ob-ship__details { margin-inline: -15px; padding: 12px 15px; border-radius: 0; }
    .ob-details__grid { grid-template-columns: 1fr; gap: 14px; }
    .ob-events li { grid-template-columns: 1fr; gap: 0; }
    .ob-parcels thead { display: none; }
    .ob-parcels, .ob-parcels tbody, .ob-parcels tr, .ob-parcels td { display: block; }
    .ob-parcels tr { padding: 8px 10px; border-bottom: 1px solid var(--c-rule); }
    .ob-parcels td { padding: 1px 0; border: 0; }
    .ob-parcels td[data-label]::before { content: attr(data-label) ': '; color: var(--c-muted); }
}
