:root {
    --bg: #f3f7fb;
    --bg-soft: #eaf3f8;
    --panel: #ffffff;
    --panel2: #f8fbfd;
    --text: #102033;
    --muted: #64748b;
    --accent: #0e7490;
    --accent2: #0891b2;
    --accent-soft: #e0f4f8;
    --accent-line: #b7e4ee;
    --success: #16825d;
    --warning: #b7791f;
    --line: #dce7ef;
    --shadow: 0 18px 45px rgba(15, 52, 74, .10);
    --danger: #c24141;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(8, 145, 178, .16) 0, transparent 28%),
        linear-gradient(135deg, #f7fbff 0%, var(--bg) 44%, #eef7f9 100%);
    color: var(--text);
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    padding: 24px 18px;
    background: rgba(255, 255, 255, .88);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 12px 0 36px rgba(15, 52, 74, .07);
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-mark {
    width: 46px; height: 46px; border-radius: 15px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, #0e7490, #4fc3d7);
    color: #ffffff; font-weight: 900; font-size: 24px;
    box-shadow: 0 12px 24px rgba(8, 145, 178, .23);
}
.brand-title { font-size: 19px; font-weight: 850; color: #0f2537; }
.brand-subtitle { color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
nav { display: grid; gap: 8px; }
nav a {
    padding: 13px 14px;
    border-radius: 14px;
    color: #334155;
    background: transparent;
    font-weight: 700;
}
nav a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.sidebar-footer { position: absolute; bottom: 18px; color: #94a3b8; font-size: 12px; }
.main { margin-left: 270px; padding: 28px; }
.topbar {
    min-height: 88px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 22px;
}
h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.03em; color: #0f2537; }
p { color: var(--muted); }
.topbar p { margin: 0; max-width: 920px; }
.pill {
    border: 1px solid var(--accent-line);
    background: #ffffff;
    color: var(--accent);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(8, 145, 178, .08);
}
.pill.small { padding: 5px 10px; font-size: 12px; }
.pill.best {
    border-color: #c4f1df;
    background: #ecfdf5;
    color: var(--success);
}
.pill.selected {
    border-color: #b7e4ee;
    background: #e0f4f8;
    color: var(--accent);
}
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.card, .panel {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.card { padding: 20px; }
.card span { color: var(--muted); display: block; margin-bottom: 12px; font-weight: 700; }
.card strong { font-size: 34px; color: #0f2537; }
.panel { padding: 20px; margin-bottom: 18px; overflow-x: auto; }
.panel.narrow { max-width: 780px; }
.panel.featured {
    background: linear-gradient(135deg, #ffffff, #f0fbfd);
    border-color: var(--accent-line);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.panel-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h2 { margin: 0 0 8px; font-size: 20px; color: #0f2537; letter-spacing: -.01em; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 850; background: #f8fbfd; }
tbody tr:hover td { background: #f8fcff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 850; color: #0f2537; }
.muted { color: var(--muted); }
.button, button {
    border: 0;
    border-radius: 13px;
    padding: 11px 15px;
    background: linear-gradient(135deg, var(--accent), #06a2bd);
    color: #ffffff;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(8, 145, 178, .18);
}
.button:hover, button:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(8, 145, 178, .24); }
.button.secondary, button.secondary {
    background: #ffffff;
    color: var(--accent);
    border: 1px solid var(--accent-line);
    box-shadow: none;
}
button.choice-button { white-space: nowrap; padding: 9px 12px; font-size: 13px; }
button.choice-button.is-selected {
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #bcebd5;
    box-shadow: none;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.form-grid .wide { grid-column: span 2; }
label { color: var(--muted); display: grid; gap: 8px; font-size: 13px; font-weight: 750; }
input, select {
    width: 100%;
    padding: 12px 13px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    outline: none;
}
input:focus, select:focus {
    border-color: var(--accent2);
    box-shadow: 0 0 0 4px rgba(8, 145, 178, .12);
}
.form-actions { display: flex; align-items: flex-end; }
.score {
    display: inline-grid; place-items: center;
    min-width: 58px;
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 850;
}
.route-name { font-weight: 850; color: #0f2537; }
.route-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.best-route td {
    background: #f0fdf7;
    border-bottom-color: #c8f0dc;
}
.selected-route td {
    background: #eaf8fb;
    border-bottom-color: var(--accent-line);
}
.detail-row td { color: var(--muted); font-size: 13px; background: #fbfdff; }
.notice {
    border: 1px solid var(--accent-line);
    background: #effbfe;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    color: #0f5f73;
    font-weight: 700;
}
.notice.success {
    border-color: #bcebd5;
    background: #ecfdf5;
    color: var(--success);
}
.notice.warning {
    border-color: #f1d49a;
    background: #fff8e8;
    color: var(--warning);
}
.upload-box { display: flex; gap: 12px; align-items: center; }
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 12px 0 4px;
}
.summary-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
}
.summary-card span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 850; margin-bottom: 7px; }
.summary-card strong { font-size: 22px; color: #0f2537; }
@media (max-width: 1180px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .sidebar { position: static; width: auto; }
    .sidebar-footer { position: static; margin-top: 20px; }
    .main { margin-left: 0; padding: 18px; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: span 1; }
    .summary-grid { grid-template-columns: 1fr; }
}

/* Tracking / Control Tower */
.cards-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.compact-form { grid-template-columns: minmax(320px, 2fr) 180px; align-items: end; }
.tracking-cards { grid-template-columns: 1.1fr 1.6fr 1fr 1fr; }
.tracking-card strong { font-size: 24px; line-height: 1.12; }
.progress-line {
    height: 9px;
    border-radius: 999px;
    background: #e6eef5;
    overflow: hidden;
    margin-top: 12px;
}
.progress-line i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #16a34a);
}
.tracking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) 360px;
    gap: 18px;
    align-items: stretch;
    overflow: visible;
}
.tracking-map-card { min-width: 0; }
.map-head { align-items: flex-start; }
.route-map {
    position: relative;
    min-height: 455px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #cfe3ee;
    background:
        radial-gradient(circle at 15% 25%, rgba(14, 116, 144, .18) 0 10%, transparent 11%),
        radial-gradient(circle at 82% 21%, rgba(22, 163, 74, .14) 0 9%, transparent 10%),
        radial-gradient(circle at 63% 68%, rgba(8, 145, 178, .13) 0 7%, transparent 8%),
        linear-gradient(135deg, #e9f8fc 0%, #f8fdff 45%, #edf9f4 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}
.route-map::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(14,116,144,.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14,116,144,.075) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.68), rgba(0,0,0,.22));
}
.map-watermark {
    position: absolute;
    right: 24px;
    bottom: 20px;
    font-size: 34px;
    font-weight: 950;
    letter-spacing: -.04em;
    color: rgba(14, 116, 144, .12);
    pointer-events: none;
}
.route-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.map-point, .vessel-marker {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
}
.map-point span {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    display: block;
    border: 3px solid #ffffff;
    box-shadow: 0 8px 18px rgba(15, 52, 74, .20);
}
.map-point.origin span { background: var(--accent); }
.map-point.destination span { background: #16a34a; }
.map-point.transshipment span { background: #f59e0b; width: 13px; height: 13px; }
.map-point em, .vessel-marker em {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-style: normal;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(207, 227, 238, .9);
    color: #0f2537;
}
.vessel-marker {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #0f2537;
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 52, 74, .30);
    animation: vesselPulse 1.8s ease-in-out infinite;
}
.vessel-marker span { display: block; transform: rotate(-28deg); font-size: 18px; margin-left: 2px; }
.vessel-marker em { top: 39px; color: #0e7490; }
@keyframes vesselPulse {
    0%, 100% { box-shadow: 0 14px 30px rgba(15, 52, 74, .30), 0 0 0 0 rgba(14, 116, 144, .22); }
    50% { box-shadow: 0 14px 30px rgba(15, 52, 74, .30), 0 0 0 11px rgba(14, 116, 144, 0); }
}
.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.map-legend span { display: flex; align-items: center; gap: 7px; }
.map-legend i { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.origin-dot { background: var(--accent); }
.trans-dot { background: #f59e0b; }
.dest-dot { background: #16a34a; }
.ship-dot { background: #0f2537; }
.tracking-side { display: grid; gap: 14px; align-content: start; }
.mini-panel {
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(15, 52, 74, .06);
}
.mini-panel h3 { margin: 0 0 12px; color: #0f2537; }
dl { margin: 0; display: grid; gap: 10px; }
dt { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
dd { margin: -6px 0 0; font-weight: 800; color: #0f2537; }
.timeline {
    position: relative;
    display: grid;
    gap: 12px;
    padding-left: 6px;
}
.timeline-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
}
.timeline-dot {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    margin-top: 5px;
    background: #cbd5e1;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
}
.timeline-item.completed .timeline-dot { background: #16a34a; box-shadow: 0 0 0 1px #16a34a; }
.timeline-item.planned .timeline-dot { background: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; }
.timeline-body {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}
.timeline-top { display: flex; justify-content: space-between; gap: 12px; }
.timeline-top strong { color: #0f2537; }
.timeline-top span { color: var(--muted); font-weight: 800; font-size: 12px; white-space: nowrap; }
.connector-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.connector-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: #fbfdff;
}
.connector-card strong { display: block; color: #0f2537; margin-bottom: 8px; }
.connector-card span { color: var(--muted); font-size: 13px; }
@media (max-width: 1280px) {
    .cards-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tracking-layout { grid-template-columns: 1fr; }
    .tracking-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .connector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .compact-form, .tracking-cards, .tracking-side, .connector-grid { grid-template-columns: 1fr; }
    .route-map { min-height: 360px; }
    .map-watermark { font-size: 24px; }
    .timeline-top { display: grid; }
}
.map-point.waypoint span { background: #38bdf8; width: 11px; height: 11px; border-width: 2px; }
.map-point.waypoint em { color: #0e7490; }

/* Google-Earth-like 3D globe tracking */
.earth-panel {
    padding: 0;
    overflow: hidden;
    border-color: #cfe3ee;
}
.earth-panel .panel-head {
    padding: 20px 20px 0;
}
.earth-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}
.ghost-btn {
    border: 1px solid #cfe3ee;
    background: #ffffff;
    color: #0e7490;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 52, 74, .06);
}
.ghost-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent-line);
}
.earth-shell {
    position: relative;
    margin: 18px 20px 20px;
    height: 580px;
    min-height: 420px;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid #b9d8e5;
    background:
        radial-gradient(circle at 50% 45%, rgba(8,145,178,.22), transparent 38%),
        linear-gradient(145deg, #dff6ff, #f7fcff 44%, #e9f8f2);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.62), 0 18px 48px rgba(15, 52, 74, .13);
}
.globe-viewer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.globe-viewer .cesium-widget-credits,
.globe-viewer .cesium-credit-logoContainer {
    opacity: .72;
    transform: scale(.88);
    transform-origin: left bottom;
}
.globe-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 8px;
    text-align: center;
    color: #0f2537;
    background:
        radial-gradient(circle at 50% 42%, rgba(14,116,144,.17), transparent 33%),
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(234,247,251,.94));
    z-index: 4;
}
.globe-fallback strong { font-size: 22px; }
.globe-fallback span { color: var(--muted); font-weight: 700; }
.earth-overlay {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 3;
    width: min(360px, calc(100% - 36px));
    padding: 15px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(207, 227, 238, .82);
    box-shadow: 0 18px 42px rgba(15, 52, 74, .16);
    backdrop-filter: blur(14px);
}
.earth-overlay span,
.earth-overlay small {
    display: block;
    color: var(--muted);
    font-weight: 850;
    font-size: 12px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.earth-overlay strong {
    display: block;
    color: #0f2537;
    font-size: 22px;
    line-height: 1.12;
    margin: 4px 0;
}
@media (max-width: 980px) {
    .earth-shell { height: 430px; margin: 14px; }
    .earth-panel .panel-head { padding: 16px 16px 0; }
    .earth-actions { justify-content: flex-start; }
}

/* Fix: hidden fallback overlay must not cover the Cesium globe when the globe is loaded */
.globe-fallback[hidden] {
    display: none !important;
}

/* Professional Control Tower tracking model */
.control-tower-panel {
    border-color: #cfe3ee;
    background:
        radial-gradient(circle at 8% 0%, rgba(14,116,144,.08), transparent 28%),
        linear-gradient(180deg, #ffffff, #fbfdff);
}
.ct-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.ct-kpi {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    min-height: 112px;
    box-shadow: 0 12px 32px rgba(15, 52, 74, .07);
}
.ct-kpi:after {
    content: "";
    position: absolute;
    right: -22px;
    top: -28px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(14,116,144,.10);
}
.ct-kpi.warning:after { background: rgba(245,158,11,.16); }
.ct-kpi.danger:after { background: rgba(239,68,68,.13); }
.ct-kpi span,
.ct-kpi em {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
}
.ct-kpi strong {
    display: block;
    margin: 8px 0 4px;
    color: #0f2537;
    font-size: 34px;
    letter-spacing: -.05em;
}
.ct-grid {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: stretch;
}
.ct-card {
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 16px 38px rgba(15, 52, 74, .08);
}
.ct-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.ct-card-head h3 { margin: 0; color: #0f2537; font-size: 16px; }
.ct-card-head span:not(.risk-pill) {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 950;
}
.ct-shipment-list {
    display: grid;
    gap: 10px;
    max-height: 430px;
    overflow: auto;
    padding-right: 3px;
}
.ct-shipment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    border-radius: 17px;
    border: 1px solid #e2edf3;
    background: #fbfdff;
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ct-shipment-row:hover,
.ct-shipment-row.active {
    transform: translateY(-1px);
    border-color: var(--accent-line);
    box-shadow: 0 12px 26px rgba(14,116,144,.12);
}
.ct-shipment-row strong,
.ct-shipment-row span,
.ct-shipment-row em { display: block; }
.ct-shipment-row strong { color: #0f2537; font-size: 13px; }
.ct-shipment-row span { color: var(--muted); margin-top: 3px; font-size: 12px; font-weight: 800; }
.ct-shipment-row em {
    min-width: 52px;
    text-align: right;
    font-style: normal;
    font-weight: 950;
    color: var(--accent);
}
.ct-shipment-row.warning { border-left: 5px solid #f59e0b; }
.ct-shipment-row.critical { border-left: 5px solid #ef4444; }
.ct-shipment-row.ok { border-left: 5px solid #16a34a; }
.ct-shipment-row.arrived { border-left: 5px solid #64748b; }
.risk-pill {
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .055em;
}
.risk-pill.ok { background: #dcfce7; color: #166534; }
.risk-pill.warning { background: #fef3c7; color: #92400e; }
.risk-pill.critical { background: #fee2e2; color: #991b1b; }
.risk-pill.arrived { background: #e2e8f0; color: #334155; }
.ct-status-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(14,116,144,.10), rgba(22,163,74,.07)),
        #f8fcff;
    border: 1px solid #d7e8f1;
}
.eyebrow {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.ct-status-hero h3 {
    margin: 7px 0 4px;
    font-size: 28px;
    letter-spacing: -.04em;
    color: #0f2537;
}
.ct-status-hero p { margin: 0; color: var(--muted); font-weight: 800; }
.ct-health-ring {
    --health: 80;
    width: 104px;
    height: 104px;
    min-width: 104px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--health) * 1%), #e2edf3 0);
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 12px 28px rgba(14,116,144,.13);
}
.ct-health-ring:after {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: #ffffff;
}
.ct-health-ring strong,
.ct-health-ring span {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    line-height: 1;
}
.ct-health-ring strong { color: #0f2537; font-size: 30px; letter-spacing: -.05em; }
.ct-health-ring span { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 950; }
.journey-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(86px, 1fr);
    gap: 0;
    overflow-x: auto;
    padding: 22px 4px 16px;
    margin: 5px 0 2px;
}
.journey-stop {
    position: relative;
    min-width: 86px;
    text-align: center;
    padding: 0 7px;
}
.journey-stop:before {
    content: "";
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #d7e8f1;
    z-index: 0;
}
.journey-stop.completed:before { background: linear-gradient(90deg, #16a34a, #22c55e); }
.journey-stop i {
    position: relative;
    z-index: 1;
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f59e0b;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 1px #f59e0b;
}
.journey-stop.completed i { background: #16a34a; box-shadow: 0 0 0 1px #16a34a; }
.journey-stop strong {
    display: block;
    margin-top: 8px;
    color: #0f2537;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}
.journey-stop span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.ct-info-strip,
.iot-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.ct-info-strip div,
.iot-strip div {
    border: 1px solid #e2edf3;
    border-radius: 16px;
    padding: 12px;
    background: #fbfdff;
}
.ct-info-strip span,
.iot-strip span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.ct-info-strip strong,
.iot-strip strong {
    display: block;
    margin-top: 5px;
    color: #0f2537;
    font-size: 13px;
}
.ct-alert-list { display: grid; gap: 10px; }
.ct-alert {
    border-radius: 17px;
    border: 1px solid #e2edf3;
    padding: 13px 14px;
    background: #fbfdff;
}
.ct-alert strong,
.ct-alert span { display: block; }
.ct-alert strong { color: #0f2537; font-size: 13px; margin-bottom: 4px; }
.ct-alert span { color: var(--muted); font-weight: 800; font-size: 12px; line-height: 1.45; }
.ct-alert.warning { background: #fffbeb; border-color: #fde68a; }
.ct-alert.critical { background: #fef2f2; border-color: #fecaca; }
.ct-alert.ok { background: #f0fdf4; border-color: #bbf7d0; }
.ct-alert.info { background: #eff6ff; border-color: #bfdbfe; }
.iot-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
}
@media (max-width: 1380px) {
    .ct-grid { grid-template-columns: 280px minmax(0, 1fr); }
    .ct-alert-card { grid-column: 1 / -1; }
    .ct-alert-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
    .ct-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ct-grid { grid-template-columns: 1fr; }
    .ct-info-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .ct-kpis, .ct-info-strip, .iot-strip, .ct-alert-list { grid-template-columns: 1fr; }
    .ct-status-hero { display: grid; }
    .ct-health-ring { width: 92px; height: 92px; min-width: 92px; }
}
.upload-box.stacked {
    display: grid;
    gap: 14px;
    align-items: stretch;
}
.upload-box.stacked label {
    display: grid;
    gap: 7px;
    color: #20364a;
    font-weight: 850;
}
.upload-box.stacked small {
    color: var(--muted);
    font-weight: 700;
    line-height: 1.35;
}
.form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.notice.soft {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}
code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px 6px;
    color: #334155;
}
@media (max-width: 720px) {
    .form-grid.compact { grid-template-columns: 1fr; }
}

.search-line {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    margin: 12px 0 14px;
    align-items: end;
}
.search-line input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 12px;
    font-size: 14px;
    background: #fff;
}
.button.ghost {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}
.pill.micro {
    font-size: 10px;
    padding: 3px 7px;
    margin-top: 4px;
    display: inline-block;
}
.route-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
@media (max-width: 900px) {
    .search-line { grid-template-columns: 1fr; }
}

.imported-calc-panel {
    border: 1px solid #c7dff2;
    background: linear-gradient(135deg, #ffffff 0%, #f3fbff 100%);
}
.wide-field {
    grid-column: 1 / -1;
}
.imported-rate-form select {
    min-height: 44px;
}
.imported-help {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.section-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.section-divider::before,
.section-divider::after {
    content: "";
    height: 1px;
    background: var(--line);
    flex: 1;
}
@media (max-width: 720px) {
    .wide-field { grid-column: auto; }
}
.inline-form { margin: 0; }
.inline-form .choice-button { white-space: nowrap; }

/* Multilanguage + live API integration additions */
.language-box {
    margin: 18px 14px 10px;
    padding: 12px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 16px;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.language-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 800;
}
.language-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.lang-chip {
    text-align: center;
    text-decoration: none;
    padding: 7px 0;
    border-radius: 11px;
    border: 1px solid #dbeafe;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    background: #f8fafc;
}
.lang-chip.active,
.lang-chip:hover {
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
    color: white;
    border-color: transparent;
}
.api-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.api-card {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}
.api-card h3 { margin: 0 0 8px; }
.inline-api-form { display: grid; gap: 10px; }
.inline-api-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 800; color: #475569; }
.inline-api-form input { width: 100%; }
.button-link {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 12px;
    background: #0f766e;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
}
.api-key-list { padding-left: 18px; color: #475569; font-size: 13px; }
.api-result {
    margin-top: 10px;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    background: #0f172a;
    color: #d1fae5;
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
}
@media (max-width: 1100px) {
    .api-card-grid { grid-template-columns: 1fr; }
}

/* User workflow / offers / documents */
.hero-guide { background: linear-gradient(135deg, #ffffff, #eefbff); }
.workflow-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.workflow-ribbon span {
    padding: 9px 12px;
    border: 1px solid var(--accent-line);
    background: #ffffff;
    color: var(--accent);
    border-radius: 999px;
    font-weight: 850;
    font-size: 13px;
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.guide-card { position: relative; min-height: 240px; }
.step-badge {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-weight: 900;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-line);
    margin-bottom: 12px;
}
.formula-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #f8fbfd;
    border: 1px dashed var(--accent-line);
    color: #0f5f73;
    padding: 12px;
    border-radius: 14px;
    font-weight: 850;
    margin: 12px 0;
}
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.checklist-box {
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
}
.checklist-box h3 { margin: 0 0 10px; color: #0f2537; }
.clean-list { margin: 0; padding-left: 18px; color: var(--muted); }
.clean-list li { margin: 8px 0; }
.route-choice-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.route-choice-cards.compact { margin-top: 8px; }
.route-choice-cards div {
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 16px;
    padding: 14px;
}
.route-choice-cards strong { display: block; margin-bottom: 5px; color: #0f2537; }
.route-choice-cards span { color: var(--muted); font-size: 13px; }
.action-cell { white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.button.mini, button.mini { padding: 8px 10px; font-size: 12px; border-radius: 11px; }
.status-form {
    display: flex;
    align-items: end;
    gap: 12px;
    max-width: 620px;
}
.offer-toolbar { overflow: visible; }
.printable-document {
    max-width: 1080px;
    margin: 0 auto 24px;
    background: #ffffff;
}
.document-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 2px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 18px;
}
.document-meta { text-align: right; color: #334155; line-height: 1.65; }
.doc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.doc-box, .cmr-cell {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfdff;
    padding: 14px;
}
.doc-box h3 { margin: 0 0 10px; color: #0f2537; }
.document-table { min-width: 0; margin: 18px 0; }
.total-row td { font-size: 18px; font-weight: 900; background: #ecfdf5; color: #0f5132; }
.document-footer { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; font-size: 13px; }
.cmr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.cmr-cell.wide { grid-column: 1 / -1; }
.editable {
    min-height: 48px;
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    color: #334155;
}
.signature-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 32px;
}
.signature-row span {
    border-top: 1px solid #94a3b8;
    padding-top: 8px;
    text-align: center;
    color: var(--muted);
}
@media (max-width: 1280px) {
    .guide-grid, .route-choice-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .checklist-grid, .doc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .guide-grid, .route-choice-cards, .cmr-grid { grid-template-columns: 1fr; }
    .document-header { display: block; }
    .document-meta { text-align: left; margin-top: 12px; }
    .status-form { display: grid; }
}
@media print {
    body { background: #ffffff !important; }
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin: 0; padding: 0; }
    .panel, .printable-document { box-shadow: none !important; border: none !important; border-radius: 0 !important; }
    .printable-document { max-width: none; margin: 0; padding: 0; }
    .document-header { page-break-after: avoid; }
    a { color: #000; }
}

/* Import routes + multi-leg calculator */
.multileg-panel {
    border: 1px solid #d7e7f4;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}
.multi-leg-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.multileg-result-panel table .missing-route td {
    background: #fff7ed;
}
.warning-pill {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border: 1px solid #fed7aa !important;
}
@media (max-width: 1280px) {
    .multi-leg-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .multi-leg-form { grid-template-columns: 1fr; }
}

/* Searchable selects in calculation */
.select-search-wrap {
    display: grid;
    gap: 8px;
    width: 100%;
}
.select-search-input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    padding: 9px 11px;
    font-size: 0.92rem;
    background: #ffffff;
    color: #172033;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.select-search-input:focus {
    border-color: #24a7c8;
    box-shadow: 0 0 0 3px rgba(36, 167, 200, 0.12);
}
.select-search-hint {
    color: #718096;
    font-size: 0.78rem;
    line-height: 1.2;
}
select.js-searchable-select {
    min-height: 42px;
}
.imported-rate-form .select-search-wrap,
.multi-leg-form .select-search-wrap {
    margin-top: 6px;
}

/* Shipment Master and persistent Exception Center */
.tracking-search-form {
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr) 160px;
    align-items: end;
}
.tracking-master-form {
    margin-top: 14px;
}
.ct-details {
    border: 1px solid #e2edf3;
    border-radius: 18px;
    background: #fbfdff;
    padding: 12px 14px;
}
.ct-details summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 900;
}
.ct-kpis-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.ct-alert-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
button.mini {
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12px;
}
.compact-table {
    min-width: 720px;
    margin-bottom: 14px;
}
textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 13px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    outline: none;
    resize: vertical;
    font: inherit;
}
textarea:focus {
    border-color: var(--accent2);
    box-shadow: 0 0 0 4px rgba(8, 145, 178, .12);
}
.tracking-notes-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 18px;
    align-items: start;
}
.note-form {
    display: grid;
    gap: 12px;
}
.note-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    max-height: 360px;
    overflow: auto;
}
.note-item {
    border: 1px solid #e2edf3;
    border-radius: 16px;
    background: #fbfdff;
    padding: 12px;
}
.note-item strong,
.note-item span {
    display: block;
}
.note-item strong {
    color: #0f2537;
    font-size: 12px;
}
.note-item span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 2px;
}
.note-item p {
    margin: 8px 0 0;
    color: var(--text);
    line-height: 1.45;
}
@media (max-width: 1380px) {
    .ct-kpis-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
    .tracking-search-form, .tracking-notes-grid { grid-template-columns: 1fr; }
    .ct-kpis-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .ct-kpis-five { grid-template-columns: 1fr; }
}

/* Profi shipping workflow: schedule → booking → documents → tracking */
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 10px 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.22); vertical-align: top; }
.table-wrap th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748b); }
.selected-row { background: rgba(14, 116, 144, 0.08); }
.document-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.doc-card { border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 16px; padding: 14px; background: rgba(255,255,255,0.72); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05); }
.doc-card label { display: block; margin-top: 10px; }
.doc-card textarea { min-height: 70px; }
.form-actions form { display: inline-block; margin-right: 8px; }
.pill.small.selected { box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25) inset; }
