.customer-portal,.customer-order-journey{--portal-accent:#007eac;--portal-tint:#e9f7fc;max-width:1180px;margin:0 auto;width:100%}
[data-theme="dark"] .customer-portal,[data-theme="dark"] .customer-order-journey{--portal-accent:#57d3ff;--portal-tint:#173548}
.customer-portal{padding:16px 24px 48px}.portal-welcome{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:32px 0 28px}.portal-eyebrow{display:block;font-size:11px;letter-spacing:.12em;font-weight:700;color:var(--text-muted);margin-bottom:8px}.portal-welcome h1{font-size:clamp(26px,3.5vw,40px);line-height:1.2;letter-spacing:-.04em;font-weight:600;margin-bottom:12px}.portal-welcome p,.portal-section-heading p{color:var(--text-muted);font-size:14px}.portal-welcome-icon{width:92px;height:92px;background:var(--portal-tint);border-radius:28px;color:var(--portal-accent);display:grid;place-items:center;transform:rotate(-5deg)}.portal-welcome-icon svg{width:52px;height:52px}
.portal-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.portal-metric{display:flex;flex-direction:column;padding:22px;background:var(--white);border:1px solid var(--border-color);border-radius:18px;color:var(--text-dark);text-decoration:none;transition:transform .15s,border-color .15s}.portal-metric:hover{transform:translateY(-3px);border-color:var(--portal-accent)}.metric-top{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px;font-weight:600}.metric-top svg{width:23px;height:23px;color:var(--portal-accent)}.portal-metric strong{font-size:40px;line-height:1.5;font-weight:600;letter-spacing:-.05em}.portal-metric small{font-size:11px;color:var(--text-muted)}.metric-em_distribuicao{background:var(--portal-tint);border-color:transparent}.metric-incidence .metric-top svg{color:#bb790c}.portal-note{font-size:11px;color:var(--text-muted);margin:14px 0 28px;max-width:920px}.portal-client-switch{display:flex;gap:12px;align-items:center;margin-bottom:24px;flex-wrap:wrap}.portal-client-switch label{font-size:13px;font-weight:600}.portal-client-switch select{background:var(--white);color:var(--text-dark);border:1px solid var(--border-color);border-radius:8px;padding:10px;max-width:100%}
.portal-section-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:32px 0 20px}.portal-section-heading h2{font-size:21px;font-weight:600;margin-bottom:5px}.portal-section-heading h2 span{display:inline-block;background:var(--border-color);padding:1px 8px;border-radius:8px;font-size:13px;vertical-align:middle}.portal-text-link{color:var(--portal-accent);font-weight:600;text-decoration:none;font-size:13px}.portal-text-link:hover{text-decoration:underline}.portal-orders{display:grid;gap:18px}.portal-order{border:1px solid var(--border-color);border-radius:18px;background:var(--white);padding:24px 28px}.portal-order-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.portal-order-heading h3{font-size:20px;font-weight:600;letter-spacing:-.025em}.portal-order-heading h3 a{color:var(--text-dark);text-decoration:none}.portal-order-meta{display:flex;flex-wrap:wrap;gap:8px 24px;font-size:12px;color:var(--text-muted);margin-top:12px}.portal-order-footer{border-top:1px solid var(--border-color);padding-top:16px;display:flex;gap:12px;justify-content:space-between;align-items:center;font-size:12px;color:var(--text-muted)}
.delivery-journey{list-style:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:28px 0;margin:0}.delivery-journey li{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;color:var(--text-muted);font-size:12px;font-weight:500;gap:7px;isolation:isolate}.delivery-journey li:before{content:"";position:absolute;top:23px;left:calc(-50% + 24px);width:calc(100% - 48px);height:2px;background:var(--border-color);z-index:-1}.delivery-journey li:first-child:before{display:none}.journey-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;border:2px solid var(--border-color);background:var(--white)}.journey-icon svg{width:23px;height:23px}.delivery-journey .complete .journey-icon{background:var(--portal-tint,#e9f7fc);color:var(--portal-accent,#007eac);border-color:var(--portal-accent,#007eac)}.delivery-journey .current{color:var(--portal-accent,#007eac);font-weight:700}.delivery-journey .current .journey-icon{background:var(--portal-accent,#007eac);border-color:var(--portal-accent,#007eac);color:#fff;box-shadow:0 0 0 5px var(--portal-tint,#e9f7fc)}.delivery-journey .complete:before,.delivery-journey .current:before{background:var(--portal-accent,#007eac)}.delivery-journey small{font-size:10px;font-weight:400}.portal-empty{padding:48px;text-align:center;border:1px dashed var(--border-color);border-radius:18px;background:var(--white)}.portal-empty svg{width:44px;height:44px;color:var(--text-muted);margin-bottom:14px}.portal-empty p{color:var(--text-muted);margin-top:8px}.portal-pagination{display:flex;justify-content:center;align-items:center;gap:20px;margin-top:28px;font-size:13px}
.customer-order-journey{background:var(--white);border:1px solid var(--border-color);border-radius:18px;padding:24px;margin-bottom:24px}.customer-order-journey h3{font-size:18px}.portal-remessas{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}.portal-remessa{padding:18px;border:1px solid var(--border-color);border-radius:12px;display:flex;flex-direction:column;gap:9px;font-size:13px}.portal-remessa .badge{align-self:flex-start}.portal-remessa small{color:var(--text-muted)}.customer-portal .order-filters{border:1px solid var(--border-color);border-radius:16px;box-shadow:none}.customer-shell .nav-link[aria-current="page"]{color:var(--primary-color)}.customer-shell .tagline{font-size:11px}.customer-shell .tracking-page{max-width:1100px}.customer-shell .order-detail-page{max-width:1180px;margin:auto;padding:16px 24px}
@media(max-width:760px){.customer-portal{padding:8px 16px 32px}.portal-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.portal-metric{padding:16px}.portal-metric strong{font-size:32px}.portal-welcome{padding-top:20px}.portal-welcome-icon{display:none}.portal-order{padding:18px 16px}.portal-order-heading{align-items:flex-start}.portal-order-heading h3{font-size:17px}.portal-order-heading .badge{font-size:9px;white-space:normal;text-align:center}.portal-order-footer,.portal-section-heading{align-items:flex-start;flex-direction:column}.delivery-journey li{font-size:10px}.delivery-journey small{font-size:9px}.journey-icon{width:38px;height:38px}.journey-icon svg{width:20px;height:20px}.delivery-journey li:before{top:18px;left:calc(-50% + 19px);width:calc(100% - 38px)}.customer-shell .header-content{gap:12px}.customer-shell .nav{gap:10px;flex-wrap:wrap}.customer-shell .nav-link{font-size:12px}.customer-shell .order-detail-page{padding:12px}.customer-order-journey{padding:18px 12px}}
@media(prefers-reduced-motion:reduce){.portal-metric{transition:none}.portal-metric:hover{transform:none}}

.portal-admin-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.portal-metric.is-active{border-color:transparent}
.metric-ordered.is-active{background:color-mix(in srgb,var(--portal-accent) 20%,var(--white));box-shadow:inset 0 0 0 2px var(--portal-accent)}
.metric-ordered.is-active .metric-top,.metric-ordered.is-active .metric-top svg{color:var(--portal-accent)}
.metric-on_the_way.is-active{background:color-mix(in srgb,var(--portal-accent) 28%,var(--white));box-shadow:inset 0 0 0 2px var(--portal-accent)}
.metric-on_the_way.is-active .metric-top,.metric-on_the_way.is-active .metric-top svg{color:var(--portal-accent)}
.metric-issues.is-active{background:color-mix(in srgb,#bb790c 22%,var(--white));box-shadow:inset 0 0 0 2px #bb790c}
.metric-issues.is-active .metric-top,.metric-issues.is-active .metric-top svg{color:#a46b06}
.metric-delivered.is-active{background:color-mix(in srgb,var(--success-color) 20%,var(--white));box-shadow:inset 0 0 0 2px var(--success-color)}
.metric-delivered.is-active .metric-top,.metric-delivered.is-active .metric-top svg{color:#16845a}
[data-theme="dark"] .metric-issues.is-active .metric-top,[data-theme="dark"] .metric-issues.is-active .metric-top svg{color:#f3be55}
[data-theme="dark"] .metric-delivered.is-active .metric-top,[data-theme="dark"] .metric-delivered.is-active .metric-top svg{color:#66dbac}

/* Compact branching progress, shared by list cards and order details. */
.shipment-tree{--node-size:28px;--fork-gap:24px;--branch-pad-y:10px;--branch-pad-x:8px;--caption-block:22px;--spine:calc(var(--branch-pad-y) + var(--caption-block) + var(--node-size) / 2);display:grid;grid-template-columns:120px minmax(0,1fr);gap:var(--fork-gap);margin:16px 0 6px;font-size:11px}
.shipment-node{width:var(--node-size);height:var(--node-size);border:1.5px solid var(--border-color);border-radius:50%;display:grid;place-items:center;background:var(--white);color:var(--text-muted);position:relative;z-index:1;flex-shrink:0}
.shipment-node svg{width:16px;height:16px}
.shipment-origin{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding-top:calc(var(--spine) - var(--node-size) / 2);color:var(--text-muted)}
.shipment-origin .shipment-node{color:var(--portal-accent);border-color:var(--portal-accent);background:var(--portal-tint)}
.shipment-origin:after{content:"";position:absolute;top:var(--spine);left:calc(50% + var(--node-size) / 2);right:0;height:2px;background:var(--portal-accent)}
.shipment-branches{min-width:0}
.shipment-provider{margin:0;flex:1;min-width:0;font-size:11px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shipment-provider strong{color:var(--text-dark);font-weight:600}
.shipment-branch{position:relative;padding:var(--branch-pad-y) var(--branch-pad-x) 12px;min-width:0;border-radius:12px}
.shipment-branch:before{content:"";position:absolute;left:calc(-1 * var(--fork-gap));top:0;bottom:-4px;border-left:2px solid var(--portal-accent)}
.shipment-branch:first-child:before{top:var(--spine)}
.shipment-branch:last-child:before{bottom:auto;height:var(--spine)}
.shipment-branch:only-child:before{display:none}
.shipment-branch+.shipment-branch{margin-top:4px}
.shipment-caption{height:16px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px;font-size:11px}
.shipment-branch.is-clickable{cursor:pointer}
.shipment-branch.is-clickable:hover{background:color-mix(in srgb,var(--portal-accent) 14%,var(--white));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--portal-accent) 42%,transparent)}
.shipment-branch.is-clickable:hover .shipment-title{color:var(--portal-accent)}
.shipment-open{position:absolute;inset:0;z-index:2;border-radius:inherit}
.shipment-open:focus-visible{outline:2px solid var(--portal-accent);outline-offset:2px}
.shipment-title{color:var(--text-dark);font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shipment-reference{font-weight:400;color:var(--text-muted);font-size:10px}
.shipment-state{font-size:10px;color:var(--text-muted);text-align:right;flex-shrink:0;padding-left:8px}
.shipment-state.is-delivered{color:#16845a}.shipment-state.is-warning{color:#a46b06}
.shipment-track{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));position:relative;margin:0;padding:0}
.shipment-track:before{content:"";position:absolute;left:calc(-1 * var(--fork-gap) - var(--branch-pad-x));top:calc(var(--node-size) / 2);width:calc(16.6667% + var(--fork-gap) + var(--branch-pad-x));border-top:2px solid var(--portal-accent)}
.shipment-track>li{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;position:relative;color:var(--text-muted);font-size:11px;line-height:1.25;min-width:0}
.shipment-track>li:not(:first-child):before{content:"";position:absolute;left:-50%;width:100%;top:calc(var(--node-size) / 2);border-top:2px solid var(--border-color)}
.shipment-track .is-reached:not(:first-child):before{border-color:var(--portal-accent)}
.shipment-track .is-reached .shipment-node{border-color:var(--portal-accent);color:var(--portal-accent);background:var(--portal-tint)}
.shipment-track .is-reached.is-current .shipment-node{background:var(--portal-accent);color:#fff}
.shipment-track .is-current{font-weight:600;color:var(--text-dark)}
.shipment-branch.is-pending .shipment-track:before{border-top-style:dashed;border-color:var(--border-color)}
.shipment-branch.is-pending .is-current .shipment-node{border-style:dashed}
.shipment-branch.has-issue .is-current .shipment-node{color:#a46b06;border-color:#a46b06}
.shipment-articles{position:relative;z-index:4;max-width:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;line-height:inherit;cursor:pointer;text-decoration:underline dotted;text-underline-offset:3px}
.shipment-articles-pop{display:none;position:absolute;z-index:5;top:100%;left:0;width:max-content;max-width:min(260px,70vw);padding-top:8px;text-align:left}
.has-articles:hover .shipment-articles-pop,.has-articles:focus-within .shipment-articles-pop,.has-articles.is-open .shipment-articles-pop{display:block}
.shipment-articles-pop ul{list-style:none;margin:0;padding:4px 10px;background:var(--white);border:1px solid var(--border-color);border-radius:10px;box-shadow:var(--shadow-lg);color:var(--text-dark)}
.shipment-articles-pop li{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-top:1px solid var(--border-color);font-size:12px;font-weight:400;line-height:1.4}
.shipment-articles-pop li:first-child{border-top:0}
.shipment-articles-pop li span{overflow-wrap:anywhere}.shipment-articles-pop li strong{white-space:nowrap;font-variant-numeric:tabular-nums}
.shipment-items{position:relative;z-index:3;margin-top:10px;font-size:11px;color:var(--text-muted);pointer-events:none}
.shipment-items summary{display:flex;align-items:center;gap:8px;pointer-events:none}
.shipment-items-toggle{pointer-events:auto;cursor:pointer;color:var(--text-muted)}
.shipment-items-toggle:before{content:"";display:inline-block;width:0;height:0;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:5px solid currentColor;vertical-align:middle}
.shipment-items[open] .shipment-items-toggle:before{transform:rotate(90deg);transform-origin:left center}
.shipment-items-toggle:hover{color:var(--portal-accent)}
.shipment-items summary::-webkit-details-marker{display:none}
.shipment-items summary{list-style:none}
.shipment-items[open] p,.shipment-items[open] ul{pointer-events:auto}
.shipment-items p{margin-top:10px}.shipment-items ul{list-style:none;margin:8px 0 0;padding:0}
.shipment-items li{display:flex;justify-content:space-between;gap:16px;padding:7px 0;border-top:1px solid var(--border-color)}
.shipment-items li span{overflow-wrap:anywhere}.shipment-items li strong{white-space:nowrap}
[data-theme="dark"] .shipment-state.is-delivered{color:#66dbac}[data-theme="dark"] .shipment-state.is-warning,[data-theme="dark"] .shipment-branch.has-issue .is-current .shipment-node{color:#f3be55}
@media(max-width:600px){.shipment-tree{grid-template-columns:68px minmax(0,1fr);--fork-gap:12px;--node-size:24px;--branch-pad-y:8px;--branch-pad-x:6px;gap:12px;margin-top:18px}.shipment-origin{font-size:9px}.shipment-caption{font-size:10px}.shipment-reference{display:none}.shipment-state{font-size:9px;max-width:50%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.shipment-track>li{font-size:9px;gap:6px}.shipment-node svg{width:14px;height:14px}.shipment-items{font-size:10px}.shipment-items summary{line-height:1.6}.shipment-track>li:last-child span:last-child{overflow-wrap:anywhere}}
