﻿/* Portal de clientes · rastreo con mapa 3D */
.portal { padding-top: calc(var(--top-h) + 30px); min-height: 100vh; }
.portal > section { margin-bottom: 22px; }
.p-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.p-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 800; margin-top: 10px; }
.p-head p { color: var(--texto-suave); font-weight: 600; margin-top: 4px; }
.p-kpis { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kpi { padding: 10px 16px; border-radius: 16px; display: flex; align-items: baseline; gap: 8px; font-size: .78rem; font-weight: 600; color: var(--texto-suave); box-shadow: var(--sombra-s); }
.kpi b { font-size: 1.4rem; font-weight: 900; color: var(--navy); }

.track-search { border-radius: var(--r-l); padding: 10px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.ts-input { position: relative; }
.ts-input .ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--acero); width: 22px; height: 22px; }
.ts-input input { width: 100%; height: 58px; border-radius: 18px; border: 1.5px solid rgba(27, 52, 93, .1); background: rgba(255, 255, 255, .85); padding: 0 18px 0 52px; font-size: 1.02rem; font-weight: 600; color: var(--navy); outline: none; letter-spacing: .02em; transition: border-color .25s, box-shadow .25s; }
.ts-input input:focus { border-color: var(--naranja); box-shadow: 0 0 0 5px rgba(255, 94, 0, .12); }
.track-search .btn { height: 58px; padding: 0 30px; border-radius: 18px; }
.ts-examples { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 2px 8px 4px; font-size: .78rem; font-weight: 600; color: var(--texto-suave); }
.ts-examples button { padding: 5px 11px; border-radius: 999px; background: var(--niebla); color: var(--navy); font-weight: 700; font-size: .74rem; transition: all .2s; }
.ts-examples button:hover { background: var(--naranja); color: #fff; }

.map-wrap {
  position: relative; height: min(74vh, 720px); min-height: 460px; border-radius: var(--r-l); overflow: hidden; isolation: isolate;
  background: radial-gradient(80% 90% at 30% 20%, #ffffff 0%, #f3f6fa 55%, #e6ecf4 100%); border: 1px solid #fff; box-shadow: var(--sombra-m);
}
.map-wrap::after { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(27, 52, 93, .07) 1px, transparent 1.2px); background-size: 18px 18px; }
.wm-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; color: var(--texto-suave); }
.map-loading span { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--linea); border-top-color: var(--naranja); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.map-empty { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 999px; background: rgba(255, 255, 255, .75); border: 1px solid #fff; box-shadow: var(--sombra-s); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-size: .84rem; color: var(--texto-suave); white-space: nowrap; }
.map-empty b { color: var(--navy); }
.map-empty .me-ico { width: 32px; height: 32px; border-radius: 50%; background: var(--naranja); color: #fff; display: grid; place-items: center; }
.map-empty .me-ico .ico { width: 16px; height: 16px; }

.ship-card { position: absolute; left: 18px; top: 18px; z-index: 2; width: min(330px, calc(100% - 36px)); border-radius: 22px; padding: 18px; animation: pop .5s var(--ease); }
.sc-top { display: flex; align-items: center; gap: 12px; }
.sc-mode { width: 42px; height: 42px; border-radius: 14px; background: var(--navy); color: #fff; display: grid; place-items: center; }
.sc-top small { display: block; font-size: .66rem; font-weight: 800; letter-spacing: .14em; color: var(--acero); }
.sc-top b { color: var(--navy); font-size: 1rem; letter-spacing: .03em; }
.sc-status { margin-left: auto; padding: 5px 10px; border-radius: 999px; background: rgba(255, 94, 0, .12); color: var(--naranja); font-size: .7rem; font-weight: 800; white-space: nowrap; }
.sc-route { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; gap: 10px; margin: 16px 0 14px; }
.sc-route b { display: block; font-size: 1.3rem; font-weight: 900; color: var(--navy); line-height: 1; }
.sc-route span { font-size: .72rem; color: var(--texto-suave); font-weight: 600; }
.sc-route .r { text-align: right; }
.sc-line { position: relative; height: 2px; align-self: center; background: repeating-linear-gradient(90deg, var(--noche) 0 6px, transparent 6px 11px); }
.sc-line .ico { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; color: var(--naranja); border-radius: 50%; padding: 5px; width: 28px; height: 28px; box-shadow: var(--sombra-s); }
.sc-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.sc-kv dt { font-size: .66rem; font-weight: 700; color: var(--acero); text-transform: uppercase; letter-spacing: .08em; }
.sc-kv dd { margin: 2px 0 0; font-size: .82rem; font-weight: 700; color: var(--navy); }
.sc-hint { margin-top: 14px; font-size: .72rem; color: var(--texto-suave); display: flex; gap: 6px; align-items: center; }
.sc-hint .ico { color: var(--naranja); width: 16px; height: 16px; }

.map-ctrl { position: absolute; right: 18px; top: 18px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.map-ctrl button { width: 42px; height: 42px; border-radius: 14px; font-size: 1.3rem; font-weight: 700; color: var(--navy); display: grid; place-items: center; transition: all .2s; }
.map-ctrl button:hover { background: var(--naranja); color: #fff; }
.map-ctrl .ico { width: 18px; height: 18px; }
.map-legend { position: absolute; left: 18px; bottom: 18px; z-index: 2; display: flex; gap: 16px; padding: 10px 16px; border-radius: 14px; font-size: .72rem; font-weight: 600; color: var(--navy); flex-wrap: wrap; }
.map-legend > span { display: flex; align-items: center; gap: 7px; }
.lg-pin, .lg-hub { width: 10px; height: 10px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--naranja); }
.lg-hub { background: var(--navy); }
.lg-route { width: 22px; height: 3px; border-radius: 3px; background: var(--noche); }

.map-tip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 14px)); min-width: 200px; max-width: 280px; padding: 14px 16px; border-radius: 18px; pointer-events: none; font-size: .78rem; color: var(--grafito);
  background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .85); box-shadow: 0 18px 50px rgba(14, 30, 56, .22); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); }
.map-tip::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg); background: rgba(255, 255, 255, .75); border-right: 1px solid #fff; border-bottom: 1px solid #fff; }
.map-tip .tt-k { display: block; font-size: .62rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--naranja); }
.map-tip b { display: block; color: var(--navy); font-size: .95rem; margin: 2px 0 4px; }
.map-tip dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0 0; }
.map-tip dt { color: var(--acero); font-weight: 700; }
.map-tip dd { margin: 0; font-weight: 600; color: var(--navy); }
.tt-bar { height: 5px; border-radius: 5px; background: rgba(27, 52, 93, .12); margin-top: 10px; overflow: hidden; }
.tt-bar i { display: block; height: 100%; background: var(--naranja); border-radius: 5px; }
.tt-pct { font-size: .68rem; font-weight: 700; color: var(--texto-suave); }

/* Barra de origen a destino */
.journey { border-radius: var(--r-l); padding: 26px 30px 22px; margin-bottom: 22px; }
.jb-ends { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; }
.jb-end small, .jb-mid small { display: block; font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--acero); }
.jb-end b { display: block; font-size: 1.35rem; font-weight: 800; color: var(--navy); margin: 2px 0; }
.jb-end span { font-size: .8rem; color: var(--texto-suave); font-weight: 600; }
.jb-end.r { text-align: right; }
.jb-mid { text-align: center; }
.jb-mid .pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 94, 0, .12); color: var(--naranja); font-size: .74rem; font-weight: 800; }
.jb-mid .pill .ico { width: 15px; height: 15px; }
.jb-pct { display: block; font-size: 2.4rem; font-weight: 900; color: var(--navy); line-height: 1.1; margin-top: 6px; }
.jb-track { position: relative; height: 66px; margin: 44px 40px 8px; }
.jb-rail, .jb-fill { position: absolute; left: 0; top: 20px; height: 8px; border-radius: 8px; }
.jb-rail { right: 0; background: repeating-linear-gradient(90deg, rgba(14, 30, 56, .18) 0 8px, transparent 8px 14px); }
.jb-fill { width: 0; background: linear-gradient(90deg, var(--noche), var(--navy) 60%, var(--naranja)); box-shadow: 0 4px 14px rgba(255, 94, 0, .3); }
.jb-dot { position: absolute; top: 16px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; width: 0; }
.jb-dot i { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid rgba(14, 30, 56, .2); flex: none; }
.jb-dot.done i { border-color: var(--noche); background: var(--noche); }
.jb-dot.now i { border-color: var(--naranja); background: #fff; }
.jb-dot em { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .66rem; font-weight: 700; color: var(--texto-suave); white-space: nowrap; text-align: center; }
.jb-dot.up em { top: -24px; }
.jb-dot:first-of-type em { left: -8px; transform: none; }
.jb-dot:nth-last-of-type(2) em { left: auto; right: -8px; transform: none; }
.jb-dot.done em { color: var(--navy); }
.jb-dot.now em { display: none; }
.jb-vehicle { position: absolute; top: 24px; left: 0; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: var(--naranja); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 6px rgba(255, 94, 0, .18), 0 10px 24px rgba(255, 94, 0, .45); z-index: 2; }
.jb-vehicle .ico { width: 22px; height: 22px; }
.jb-foot { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: .8rem; font-weight: 600; color: var(--texto-suave); padding-top: 12px; border-top: 1px solid var(--linea); }
.jb-foot span { display: flex; align-items: center; gap: 8px; }
.jb-foot .ico { color: var(--naranja); }

.p-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 22px; }
.p-card { border-radius: var(--r-l); padding: 24px; }
.p-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 18px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.timeline li::before { content: ''; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--linea); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--noche); }
.timeline i { width: 26px; height: 26px; border-radius: 50%; flex: none; border: 2px solid rgba(14, 30, 56, .2); background: #fff; display: grid; place-items: center; color: #fff; }
.timeline i .ico { width: 14px; height: 14px; stroke-width: 3; }
.timeline li.done i { background: var(--noche); border-color: var(--noche); }
.timeline li.now i { background: var(--naranja); border-color: var(--naranja); box-shadow: 0 0 0 6px rgba(255, 94, 0, .18); animation: live 1.8s infinite; }
.timeline b { display: block; color: var(--navy); font-size: .88rem; }
.timeline span { font-size: .76rem; color: var(--texto-suave); font-weight: 600; }
.timeline li:not(.done) b { color: var(--texto-suave); }
.kv { margin: 0; display: grid; gap: 0; }
.kv div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--linea); font-size: .84rem; }
.kv dt { color: var(--texto-suave); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; color: var(--navy); text-align: right; }
.docs { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.docs li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .7); border: 1px solid var(--linea); font-size: .84rem; font-weight: 700; color: var(--navy); }
.docs li > .ico { color: var(--naranja); width: 22px; height: 22px; }
.docs small { display: block; font-weight: 600; color: var(--texto-suave); font-size: .7rem; }
.docs .btn { margin-left: auto; padding: 8px; }
.docs .btn .ico { transform: rotate(180deg); }
.docs .btn[disabled] { opacity: .45; cursor: not-allowed; }
.exec { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--niebla); font-size: .8rem; color: var(--texto-suave); }
.exec-links { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.exec-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); font-weight: 700; transition: color .2s; }
.exec-links a:hover { color: var(--naranja); }
.exec-links .ico { width: 16px; height: 16px; color: var(--naranja); }
.exec img { width: 40px; height: 40px; border-radius: 12px; }
.exec b { display: block; color: var(--navy); font-size: .84rem; }

.table-scroll { overflow-x: auto; }
.ship-table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 720px; }
.ship-table th { text-align: left; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--acero); padding: 0 12px 12px; }
.ship-table td { padding: 14px 12px; border-top: 1px solid var(--linea); color: var(--navy); font-weight: 600; vertical-align: middle; }
.ship-table td small { display: block; color: var(--texto-suave); font-size: .72rem; }
.ship-table td .ico { color: var(--naranja); vertical-align: -4px; }
.ship-table tr[data-code] { cursor: pointer; transition: background .2s; }
.ship-table tr[data-code]:hover { background: rgba(255, 94, 0, .05); }
.mini-bar { width: 90px; height: 6px; border-radius: 6px; background: var(--niebla); overflow: hidden; display: inline-block; margin-right: 8px; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: var(--naranja); }

@media (max-width: 900px) {
  .p-grid { grid-template-columns: 1fr; }
  .jb-ends { grid-template-columns: 1fr 1fr; }
  .jb-mid { grid-column: 1 / -1; order: -1; }
  .jb-dot em { display: none; }
  .map-wrap { height: 70svh; }
  .ship-card { top: auto; bottom: 64px; left: 12px; padding: 14px; }
  .ship-card .sc-kv, .ship-card .sc-hint { display: none; }
  .map-legend { left: 12px; right: 12px; bottom: 12px; padding: 8px 12px; gap: 10px; font-size: .64rem; }
  .map-empty { white-space: normal; width: calc(100% - 90px); left: 16px; transform: none; border-radius: 18px; }
}
@media (max-width: 600px) {
  .track-search { grid-template-columns: 1fr; }
  .track-search .btn { justify-content: center; }
  .journey { padding: 20px 16px; }
  .p-kpis .kpi { flex: 1; }
}

/* ---- Portal conectado a INTERTRANS ONE */
.ts-msg { grid-column: 1 / -1; font-size: .8rem; font-weight: 700; padding: 0 8px; min-height: 0; }
.ts-msg.bad { color: #c62a2f; }
.track-search .btn.loading { opacity: .7; }
.p-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.p-sub { font-size: .8rem; color: var(--texto-suave); margin: -8px 0 14px; }
.p-note { grid-column: 1 / -1; font-size: .74rem; color: var(--texto-suave); margin-top: 10px; }
.p-sim { display: inline-block; font-size: .6rem; font-weight: 900; letter-spacing: .08em; color: #b84300; background: #fff2e8; border: 1px dashed #ff9a5c; border-radius: 5px; padding: 1px 5px; }
.p-st { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(74, 106, 150, .14); color: var(--navy); }
.p-st.ok { background: rgba(31, 157, 85, .12); color: #137a3f; }
.p-st.warn { background: rgba(255, 94, 0, .12); color: #a93e00; }
.p-st.bad { background: rgba(229, 72, 77, .12); color: #b4262b; }
.p-docs, .p-checks, .p-quotes, .p-reqs, .p-notifs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.p-docs li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .6); border: 1px solid var(--linea); }
.p-docs li.todo { border-color: rgba(255, 94, 0, .35); }
.p-docs li.busy { opacity: .55; pointer-events: none; }
.p-docs li > .ico { width: 20px; height: 20px; color: var(--acero); flex: none; }
.p-docs li span { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: .84rem; min-width: 0; }
.p-docs li em, .p-checks em { font-style: normal; font-size: .74rem; color: #a93e00; }
.p-docs label.btn { cursor: pointer; }
.p-progress { height: 8px; border-radius: 6px; background: rgba(27, 52, 93, .08); overflow: hidden; margin: 10px 0 14px; }
.p-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--naranja), var(--naranja-2)); border-radius: 6px; }
.p-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: .82rem; }
.p-checks li .ico { width: 16px; height: 16px; flex: none; color: var(--bruma); margin-top: 2px; }
.p-checks li.ok .ico { color: #1f9d55; }
.p-checks li.bad .ico { color: #e5484d; }
.p-checks span { display: flex; flex-direction: column; }
.p-quotes li, .p-reqs li, .p-notifs li { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .6); border: 1px solid var(--linea); font-size: .82rem; }
.p-quotes li span, .p-reqs small, .p-notifs small, .p-notifs em { color: var(--texto-suave); font-size: .76rem; font-style: normal; }
.p-quotes li small { width: max-content; }
.p-notifs li.new { border-color: rgba(255, 94, 0, .4); }
.p-reply { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--niebla); display: flex; gap: 8px; color: var(--grafito); }
.p-reply .ico { width: 16px; height: 16px; flex: none; }
.p-req { display: grid; grid-template-columns: 1fr 170px; gap: 8px; margin-bottom: 14px; }
.p-req textarea { grid-column: 1 / -1; }
.p-req input, .p-req select, .p-req textarea { padding: 10px 12px; border-radius: 11px; border: 1.5px solid rgba(27, 52, 93, .14); font: inherit; font-size: .84rem; background: #fff; }
.p-req button { grid-column: 2; justify-self: end; }
.p-docs-kpi { text-decoration: none; border: 1.5px solid rgba(255, 94, 0, .4); }
.timeline li.int i { background: var(--naranja); border-color: var(--naranja); }
.timeline em { display: block; font-style: normal; font-size: .68rem; font-weight: 700; color: var(--acero); margin-top: 2px; }
.timeline li.int em { color: var(--naranja); }
.ico.rot { transform: rotate(180deg); }
.mt { margin-top: 18px; }
.modal.open { display: grid; opacity: 1; visibility: visible; pointer-events: auto; }
.p-pw { padding: 34px; max-width: 440px; }
.p-pw form { display: flex; flex-direction: column; gap: 12px; }
.p-pw input { padding: 11px 13px; border-radius: 11px; border: 1.5px solid rgba(27, 52, 93, .14); font: inherit; width: 100%; }
@media (max-width: 900px) { .p-grid2 { grid-template-columns: 1fr; } .p-req { grid-template-columns: 1fr; } .p-req button { grid-column: 1; } }
