/* added on 17/09/2026 - Client Portal styles (self contained, no external library) */
:root {
    --ink: #0f1b2d;
    --ink-2: #44546a;
    --ink-3: #7b8aa0;
    --line: #e4e9f0;
    --bg: #f4f6fa;
    --card: #ffffff;
    --brand: #1457d9;
    --brand-dark: #0e3f9e;
    --brand-soft: #e8f0fe;
    --nav: #0c1a33;
    --nav-2: #16284a;
    --green: #0f8a4f;   --green-soft: #e3f6ec;
    --red: #cf2e2e;     --red-soft: #fdeaea;
    --amber: #b86a00;   --amber-soft: #fff3df;
    --violet: #6a3fd1;  --violet-soft: #efe9fd;
    --grey-soft: #eef1f6;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15,27,45,.05), 0 6px 20px rgba(15,27,45,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
    width: 248px; flex: none; background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
    color: #c9d4e8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand .logo {
    width: 40px; height: 40px; border-radius: 11px; background: var(--brand); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
}
.brand .co { margin-top: 12px; color: #fff; font-weight: 650; font-size: 15px; line-height: 1.3; }
.brand .tag { font-size: 12px; color: #8fa2c4; margin-top: 2px; }
.nav { padding: 14px 12px; flex: 1; }
.nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin-bottom: 4px;
    border-radius: 10px; color: #c9d4e8; font-weight: 550; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(20,87,217,.35); }
.side .foot { padding: 14px 20px 18px; font-size: 12px; color: #7f92b5; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
    background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
    padding: 12px 28px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.top .quick { flex: 1; max-width: 460px; position: relative; }
.top .quick input {
    width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg);
    padding: 0 14px 0 42px; font: inherit; color: var(--ink); outline: none;
}
.top .quick input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.top .quick svg { position: absolute; left: 13px; top: 11px; color: var(--ink-3); }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top .who .txt { text-align: right; line-height: 1.25; }
.top .who .txt b { display: block; font-size: 14px; }
.top .who .txt span { font-size: 12px; color: var(--ink-3); }
.avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.btn-out {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 9px;
    border: 1px solid var(--line); color: var(--ink-2); background: #fff; font-weight: 550; font-size: 13px;
}
.btn-out:hover { border-color: var(--red); color: var(--red); text-decoration: none; }

.page { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }

/* ---------- cards / tiles ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-h h2 { font-size: 16px; font-weight: 650; }
.card-b { padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.tiles { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 20px; }
.two { grid-template-columns: minmax(0,2fr) minmax(0,1fr); align-items: start; }
.tile { padding: 18px 20px; display: block; color: inherit; text-decoration: none; position: relative; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
a.tile:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 2px 4px rgba(15,27,45,.06), 0 14px 30px rgba(15,27,45,.10); }
.tile .lbl { font-size: 13px; color: var(--ink-2); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.tile .val { font-size: 30px; font-weight: 720; margin-top: 8px; letter-spacing: -.02em; }
.tile .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.tile .dot { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.dot.blue { background: var(--brand-soft); color: var(--brand); }
.dot.green { background: var(--green-soft); color: var(--green); }
.dot.amber { background: var(--amber-soft); color: var(--amber); }
.dot.red { background: var(--red-soft); color: var(--red); }

/* hero tracker */
.hero {
    border-radius: 18px; padding: 26px 28px; margin-bottom: 20px; color: #fff;
    background: radial-gradient(1200px 300px at 90% -40%, rgba(255,255,255,.22), transparent 60%), linear-gradient(120deg, #0e3f9e 0%, #1457d9 55%, #2b7bff 100%);
    box-shadow: 0 16px 40px rgba(20,87,217,.28);
}
.hero h2 { font-size: 21px; font-weight: 700; }
.hero p { margin: 4px 0 16px; opacity: .88; }
.hero form { display: flex; gap: 10px; max-width: 620px; }
.hero input {
    flex: 1; height: 50px; border: 0; border-radius: 12px; padding: 0 16px; font: inherit; font-size: 16px; outline: none; min-width: 0;
}
.hero button { height: 50px; padding: 0 24px; border: 0; border-radius: 12px; background: #0c1a33; color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
.hero button:hover { background: #000; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 620; white-space: nowrap; }
.chip:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-blue { background: var(--brand-soft); color: var(--brand-dark); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-grey { background: var(--grey-soft); color: var(--ink-2); }

/* ---------- table ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #f8faff; }
.tbl .lr { font-weight: 650; color: var(--ink); white-space: nowrap; }
.tbl .route { color: var(--ink-2); }
.tbl .route b { color: var(--ink); font-weight: 600; }
.tbl th.right, .tbl td.right { text-align: right; }
.tbl tfoot td { font-weight: 700; background: #fafbfd; }
.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- filters / buttons ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.fld label { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.fld input, .fld select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; color: var(--ink); background: #fff; outline: none; }
.fld input:focus, .fld select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.fld.grow { flex: 1; min-width: 180px; } .fld.grow input { width: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 620; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; } .btn-primary:hover { background: var(--brand-dark); }
.btn-light { background: #fff; color: var(--ink-2); border-color: var(--line); } .btn-light:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 20px 0; }
.tabs a { padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--grey-soft); text-decoration: none; }
.tabs a.on { background: var(--ink); color: #fff; }

/* ---------- tracking ---------- */
.stepper { display: flex; margin: 8px 0 4px; }
.step { flex: 1; text-align: center; position: relative; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.step:before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 4px; background: var(--line); border-radius: 2px; }
.step:first-child:before { display: none; }
.step .b { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--line); margin: 0 auto 8px; position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; color: #fff; }
.step.done { color: var(--ink); }
.step.done:before { background: var(--green); }
.step.done .b { background: var(--green); border-color: var(--green); }
.step.now .b { box-shadow: 0 0 0 6px var(--green-soft); }
.step small { display: block; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px 24px; }
.kv div span { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kv div b { font-weight: 600; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 22px 30px; }
.timeline li:before { content: ""; position: absolute; left: 7px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; } .timeline li:last-child:before { display: none; }
.timeline li:after { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); }
.timeline li.DEL:after { border-color: var(--green); }
.timeline li.DSR:after { border-color: var(--ink-3); }
.timeline .t { font-weight: 650; } .timeline .d { color: var(--ink-2); font-size: 14px; } .timeline .w { color: var(--ink-3); font-size: 12.5px; }
.pod-list { display: grid; gap: 10px; }
.pod { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.pod .nm { flex: 1; min-width: 0; } .pod .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.notice { padding: 12px 16px; border-radius: 12px; font-size: 14px; display: block; line-height: 1.5; }   /* changed on 18/09/2026 - was flex, split text on phones */
.notice.red { background: var(--red-soft); color: #8c1d1d; } .notice.amber { background: var(--amber-soft); color: #7a4700; }
.notice.blue { background: var(--brand-soft); color: var(--brand-dark); } .notice.green { background: var(--green-soft); color: #0a5c35; }

/* bars (dashboard chart + ageing) */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bars .bar i { display: block; width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #2b7bff, #1457d9); min-height: 4px; }
.bars .bar b { font-size: 13px; margin-bottom: 6px; } .bars .bar span { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.age { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.age div { padding: 14px; border-radius: 12px; background: var(--grey-soft); }
.age div span { font-size: 12px; color: var(--ink-2); font-weight: 600; } .age div b { display: block; font-size: 18px; margin-top: 4px; }
.age div.hot { background: var(--red-soft); } .age div.hot b { color: var(--red); }

/* viewer */
.viewer { position: fixed; inset: 0; background: rgba(8,15,30,.82); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.viewer.open { display: flex; }
.viewer .box { background: #fff; border-radius: 16px; max-width: 980px; width: 100%; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.viewer .bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.viewer .bar b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .body { min-height: 160px; overflow: auto; background: #1c2436; text-align: center; flex: 1; }
.viewer img { max-width: 100%; display: block; margin: 0 auto; } .viewer iframe { width: 100%; height: 78vh; border: 0; background: #fff; }

/* ---------- mobile ---------- */
.mnav { display: none; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); } .two { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
    .side { display: none; }
    .top { padding: 10px 16px; } .top .who .txt, .top .quick { display: none; }
    .top .mbrand { display: block !important; font-weight: 700; }
    .page { padding: 18px 16px 96px; }
    .page-head h1 { font-size: 21px; }
    .hero { padding: 20px; } .hero form { flex-direction: column; } .hero input { flex: none; width: 100%; } .hero button { width: 100%; }
    .kv { grid-template-columns: repeat(2, minmax(0,1fr)); } .age { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .tile .val { font-size: 25px; }
    .pod { flex-wrap: wrap; } .pod .nm { flex: 1 1 60%; }   /* added on 17/09/2026 - POD buttons go to next line on narrow phones */
    .step { font-size: 11.5px; } .step small { display: none; }
    .mnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
    .mnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 6px 0; text-decoration: none; }
    .mnav a.on { color: var(--brand); }
    /* tables become cards */
    table.tbl.stack thead { display: none; }
    table.tbl.stack, table.tbl.stack tbody, table.tbl.stack tr, table.tbl.stack td { display: block; width: 100%; }
    table.tbl.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
    table.tbl.stack td { border: 0; padding: 3px 0; text-align: left !important; display: flex; justify-content: space-between; gap: 14px; }
    table.tbl.stack td:before { content: attr(data-l); color: var(--ink-3); font-size: 12px; font-weight: 600; flex: none; }
    table.tbl.stack td.first { display: block; } table.tbl.stack td.first:before { display: none; }
    table.tbl.stack tfoot tr { background: #fafbfd; }
}
@media print {
    .side, .top, .mnav, .no-print { display: none !important; }
    body { background: #fff; } .page { padding: 0; max-width: none; } .card { box-shadow: none; }
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
    color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(900px 500px at 10% 110%, rgba(43,123,255,.55), transparent 60%), linear-gradient(150deg, #0c1a33 0%, #10306f 60%, #1457d9 100%);
}
.login-art h1 { font-size: 38px; line-height: 1.15; font-weight: 750; max-width: 480px; }
.login-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; max-width: 440px; }
.login-art li { display: flex; gap: 12px; align-items: flex-start; opacity: .92; }
.login-art li svg { margin-top: 2px; color: #7fb0ff; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-form .inner { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 26px; font-weight: 720; } .login-form p.s { color: var(--ink-2); margin: 6px 0 26px; }
.login-form label { display: block; font-size: 13px; font-weight: 620; margin: 16px 0 6px; }
.login-form input[type=text], .login-form input[type=password] { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 16px; outline: none; }
.login-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.login-form .go { width: 100%; height: 50px; margin-top: 24px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font: inherit; font-size: 16px; font-weight: 650; cursor: pointer; }
.login-form .go:hover { background: var(--brand-dark); }
.login-form .err { margin-top: 16px; }
.login-form .help { margin-top: 22px; font-size: 13px; color: var(--ink-3); text-align: center; }
.pw { position: relative; } .pw a { position: absolute; right: 12px; top: 13px; font-size: 13px; font-weight: 600; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* long invoice lists are clipped in the list (full text on hover and in tracking page) */
.clip { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* added on 18/09/2026 - transporter logo */
.logo-box { background: #fff; border-radius: 12px; padding: 8px 10px; display: block; }
.logo-box img { display: block; width: 100%; height: auto; max-height: 80px; object-fit: contain; }
.login-logo { display: inline-block; width: 240px; margin-bottom: 14px; }
.mobile-only { display: none; }
.mlogo { height: 38px; width: auto; display: block; }
@media (max-width: 900px) { .mobile-only { display: inline-block; } }

/* added on 18/09/2026 - mobile pass : tiles as full-width rows, short top bar, no clipped amounts */
.tiles-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 1100px) { .tiles-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 820px) {
    .tiles, .tiles-3 { grid-template-columns: 1fr !important; gap: 10px; margin-bottom: 16px; }
    .tile { display: flex; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
    .tile .lbl { flex: 1 1 auto; font-size: 14px; }
    .tile .val { flex: none; margin: 0; font-size: 22px; white-space: nowrap; }
    .tile .sub { flex-basis: 100%; margin-top: 2px; }
    .tile .val span { font-size: 13px !important; }
    .top { gap: 10px; }
    .top .mbrand { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
    .top .who { gap: 8px; }
    .btn-out { padding: 0 10px; } .btn-out .so-txt { display: none; }
    .avatar { width: 34px; height: 34px; font-size: 13px; }
    .page-head { margin-bottom: 14px; } .page-head .btn { height: 36px; }
    .age { gap: 8px; } .age div { padding: 10px 12px; } .age div b { font-size: 16px; white-space: nowrap; }
    .card-h { padding: 12px 16px; } .card-b { padding: 14px 16px; }
    .kv { gap: 12px 16px; } .kv div b { font-size: 14px; }
    .hero h2 { font-size: 19px; }
    .filters { padding: 12px 16px; } .fld { flex: 1 1 45%; } .fld input, .fld select { width: 100%; }
    .filters .btn { flex: 1 1 45%; }
    .tabs { padding: 10px 16px 0; gap: 5px; } .tabs a { padding: 6px 11px; font-size: 12.5px; }
    table.tbl.stack tr { padding: 10px 16px; }
    .empty { padding: 30px 16px; }
}

/* added on 18/09/2026 - POD + Print LR buttons side by side in one cell */
.docs { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tbl .btn-sm svg { margin-right: -2px; }
.tbl th, .tbl td { padding-left: 12px; padding-right: 12px; }
.clip { max-width: 108px; }

/* added on 18/09/2026 - the print column stays visible at the right edge even when the list is wider than the screen */
.tbl th.act, .tbl td.act { position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -10px 0 10px -10px rgba(15,27,45,.18); white-space: nowrap; }
.tbl th.act { background: #fafbfd; }
.tbl tbody tr:hover td.act { background: #f8faff; }
.tbl tfoot td.act { background: #fafbfd; }
@media (max-width: 820px) { table.tbl.stack td.act { position: static; box-shadow: none; white-space: normal; } }
.tbl td.pty { max-width: 190px; font-size: 13.5px; } .tbl td.route { max-width: 170px; }
@media (max-width: 820px) { .tbl td.pty, .tbl td.route { max-width: none; font-size: inherit; } }
