/* =========================================================
   PACDBS theme — built on Bootstrap 5.3
   ========================================================= */
:root {
    --pac-sidebar-w: 264px;
    --pac-sidebar-w-mini: 78px;
    --pac-topbar-h: 64px;
    --pac-radius: 14px;

    --pac-primary: #2456d6;
    --pac-primary-hover: #1c46b3;
    --pac-primary-soft: rgba(36, 86, 214, .10);
    --pac-accent: #16a3b8;

    --pac-bg: #f3f6fb;
    --pac-surface: #ffffff;
    --pac-surface-2: #f8fafd;
    --pac-border: #e4e9f2;
    --pac-text: #1e293b;
    --pac-muted: #64748b;
    --pac-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);

    --pac-side-bg: #0c1a3a;
    --pac-side-bg-2: #102451;
    --pac-side-text: #b7c3dc;
    --pac-side-muted: #6f80a6;
    --pac-side-active: #ffffff;

    --bs-body-font-family: "Inter", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-bg: var(--pac-bg);
    --bs-body-color: var(--pac-text);
    --bs-border-color: var(--pac-border);
    --bs-primary: var(--pac-primary);
    --bs-primary-rgb: 36, 86, 214;
    --bs-link-color: var(--pac-primary);
    --bs-link-color-rgb: 36, 86, 214;
    --bs-link-hover-color: var(--pac-primary-hover);
}

[data-bs-theme="dark"] {
    --pac-primary: #5b8cff;
    --pac-primary-hover: #7aa2ff;
    --pac-primary-soft: rgba(91, 140, 255, .14);
    --pac-bg: #0a1122;
    --pac-surface: #111a2e;
    --pac-surface-2: #0e1628;
    --pac-border: #1f2b45;
    --pac-text: #e2e8f0;
    --pac-muted: #94a3b8;
    --pac-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --pac-side-bg: #070e1f;
    --pac-side-bg-2: #0b1731;

    --bs-body-bg: var(--pac-bg);
    --bs-body-color: var(--pac-text);
    --bs-border-color: var(--pac-border);
    --bs-primary-rgb: 91, 140, 255;
    --bs-link-color: var(--pac-primary);
    --bs-link-color-rgb: 91, 140, 255;
    --bs-secondary-bg: #16213a;
    --bs-tertiary-bg: #131d33;
}

html, body { min-height: 100%; }
body {
    background: var(--pac-bg);
    color: var(--pac-text);
    font-size: .925rem;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }

.btn-primary {
    --bs-btn-bg: var(--pac-primary);
    --bs-btn-border-color: var(--pac-primary);
    --bs-btn-hover-bg: var(--pac-primary-hover);
    --bs-btn-hover-border-color: var(--pac-primary-hover);
    --bs-btn-active-bg: var(--pac-primary-hover);
    --bs-btn-active-border-color: var(--pac-primary-hover);
    --bs-btn-disabled-bg: var(--pac-primary);
    --bs-btn-disabled-border-color: var(--pac-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--pac-primary);
    --bs-btn-border-color: var(--pac-primary);
    --bs-btn-hover-bg: var(--pac-primary);
    --bs-btn-hover-border-color: var(--pac-primary);
    --bs-btn-active-bg: var(--pac-primary);
}
.btn { border-radius: 10px; font-weight: 500; }
.btn-sm { border-radius: 8px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--pac-border); background-color: var(--pac-surface); }
.form-control:focus, .form-select:focus { border-color: var(--pac-primary); box-shadow: 0 0 0 .2rem var(--pac-primary-soft); }
.form-label { font-weight: 500; font-size: .83rem; color: var(--pac-muted); margin-bottom: .3rem; }
.text-muted-2 { color: var(--pac-muted) !important; }

/* ---------- App shell ---------- */
.pac-app { display: flex; min-height: 100vh; }

.pac-sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--pac-sidebar-w);
    background: linear-gradient(180deg, var(--pac-side-bg) 0%, var(--pac-side-bg-2) 100%);
    color: var(--pac-side-text);
    display: flex; flex-direction: column;
    z-index: 1040;
    transition: width .22s ease, transform .22s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .75rem;
    height: var(--pac-topbar-h); padding: 0 1.25rem;
    color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .06);
    white-space: nowrap; overflow: hidden;
}
.sidebar-brand:hover { color: #fff; }
/* PAC logo (red mark) sits on a white tile so it reads on the navy sidebar and in dark mode. */
.brand-logo {
    flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center; padding: 4px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.08rem; letter-spacing: .06em; }
.brand-text small { font-size: .7rem; color: var(--pac-side-muted); letter-spacing: .03em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .75rem 1rem; }
.nav-section {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
    color: var(--pac-side-muted); padding: 1rem .75rem .45rem; white-space: nowrap;
}
.side-link {
    position: relative;
    display: flex; align-items: center; gap: .8rem;
    padding: .62rem .8rem; margin-bottom: 2px; border-radius: 10px;
    color: var(--pac-side-text); font-weight: 500; white-space: nowrap;
    transition: background .15s, color .15s;
}
.side-link i { font-size: 1.1rem; width: 1.3rem; text-align: center; flex: 0 0 auto; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, .28), rgba(59, 130, 246, .08));
    color: var(--pac-side-active);
}
.side-link.active::before {
    content: ""; position: absolute; left: -.75rem; top: 20%; bottom: 20%;
    width: 3px; border-radius: 0 3px 3px 0; background: #60a5fa;
}
.side-link.disabled { opacity: .45; cursor: not-allowed; }
.side-link .soon {
    margin-left: auto; font-style: normal; font-size: .62rem; font-weight: 600;
    padding: .1rem .45rem; border-radius: 20px; background: rgba(255, 255, 255, .08);
}
.sidebar-footer {
    padding: .9rem 1.25rem; font-size: .75rem; color: var(--pac-side-muted);
    border-top: 1px solid rgba(255, 255, 255, .06);
    display: flex; gap: .5rem; align-items: center; white-space: nowrap; overflow: hidden;
}

.pac-main {
    flex: 1; min-width: 0;
    margin-left: var(--pac-sidebar-w);
    display: flex; flex-direction: column;
    transition: margin-left .22s ease;
}

/* Collapsed (desktop) */
@media (min-width: 992px) {
    .sidebar-collapsed .pac-sidebar { width: var(--pac-sidebar-w-mini); }
    .sidebar-collapsed .pac-main { margin-left: var(--pac-sidebar-w-mini); }
    .sidebar-collapsed .brand-text,
    .sidebar-collapsed .side-link span,
    .sidebar-collapsed .side-link .soon,
    .sidebar-collapsed .sidebar-footer span { display: none; }
    .sidebar-collapsed .nav-section { font-size: 0; padding: .6rem 0; border-top: 1px solid rgba(255, 255, 255, .06); margin: .4rem .5rem 0; }
    .sidebar-collapsed .side-link { justify-content: center; padding: .7rem 0; }
    .sidebar-collapsed .sidebar-brand { padding: 0; justify-content: center; }
    .sidebar-collapsed .sidebar-footer { justify-content: center; }
}

/* Drawer (tablet / phone) */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
    .pac-sidebar { transform: translateX(-100%); box-shadow: none; }
    .pac-main { margin-left: 0; }
    .sidebar-open .pac-sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
    .sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1035;
        background: rgba(8, 15, 35, .45); backdrop-filter: blur(2px);
    }
}

/* ---------- Topbar ---------- */
.pac-topbar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--pac-topbar-h);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.5rem;
    background: color-mix(in srgb, var(--pac-surface) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--pac-border);
}
.btn-icon {
    width: 40px; height: 40px; flex: 0 0 40px;
    display: inline-grid; place-items: center;
    border: 1px solid transparent; border-radius: 10px;
    background: transparent; color: var(--pac-muted); font-size: 1.2rem;
    transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--pac-primary-soft); color: var(--pac-primary); }
.topbar-brand { color: var(--pac-text); letter-spacing: .06em; }

.topbar-menu { gap: .25rem; align-items: center; }
.topbar-menu > a, .topbar-menu .dropdown > a {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .45rem .8rem; border-radius: 9px;
    color: var(--pac-muted); font-weight: 500;
}
.topbar-menu > a:hover, .topbar-menu .dropdown > a:hover { color: var(--pac-text); background: var(--pac-surface-2); }
.topbar-menu a.active { color: var(--pac-primary); background: var(--pac-primary-soft); }

.topbar-search {
    position: relative; align-items: center;
    flex: 1; max-width: 420px; margin-left: auto;
}
.topbar-search i { position: absolute; left: .85rem; color: var(--pac-muted); }
.topbar-search input {
    width: 100%; height: 40px; padding: 0 1rem 0 2.4rem;
    border-radius: 10px; border: 1px solid var(--pac-border);
    background: var(--pac-surface-2); color: var(--pac-text); outline: none;
}
.topbar-search input:focus { border-color: var(--pac-primary); box-shadow: 0 0 0 .2rem var(--pac-primary-soft); }

.topbar-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.sync-indicator {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .3rem .7rem; border-radius: 20px; font-size: .78rem; font-weight: 600;
    color: var(--pac-primary); background: var(--pac-primary-soft);
}
.user-chip {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .25rem .6rem .25rem .25rem; border-radius: 30px;
    border: 1px solid var(--pac-border); background: var(--pac-surface); color: var(--pac-text); font-weight: 500;
}
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #2456d6, #16a3b8);
}
[data-bs-theme="light"] .theme-icon-dark, [data-bs-theme="dark"] .theme-icon-light { display: none; }

@media (max-width: 575.98px) {
    .pac-topbar { padding: 0 .75rem; gap: .5rem; }
}

/* ---------- Content ---------- */
.pac-content { flex: 1; padding: 1.5rem; display: flex; flex-direction: column; min-height: 0; }
.card-pac-fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.card-pac-fill > .table-responsive { flex: 1; min-height: 0; overflow: auto; }
@media (max-width: 575.98px) { .pac-content { padding: 1rem; } }
.page-head {
    display: flex; flex-wrap: wrap; gap: 1rem;
    align-items: flex-end; justify-content: space-between;
    margin-bottom: 1.25rem;
}
.page-title { font-size: 1.45rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .6rem; letter-spacing: -.01em; }
.page-title i { color: var(--pac-primary); }
.page-sub { margin: .25rem 0 0; color: var(--pac-muted); }

.pac-footer {
    display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between;
    padding: 1rem 1.5rem; font-size: .78rem; color: var(--pac-muted);
    border-top: 1px solid var(--pac-border);
}

/* ---------- Cards ---------- */
.card-pac {
    background: var(--pac-surface);
    border: 1px solid var(--pac-border);
    border-radius: var(--pac-radius);
    box-shadow: var(--pac-shadow);
}
.card-pac > .card-head {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--pac-border);
}
.card-head h2, .card-head h3 { font-size: 1rem; font-weight: 600; margin: 0; display: flex; gap: .5rem; align-items: center; }
.card-head h2 i, .card-head h3 i { color: var(--pac-primary); }
.card-head .hint { font-size: .78rem; color: var(--pac-muted); }
.card-pac > .card-body-pac { padding: 1.25rem; }

/* KPI tiles */
.kpi {
    position: relative; overflow: hidden; height: 100%;
    padding: 1.1rem 1.2rem;
    display: flex; gap: 1rem; align-items: flex-start;
}
.kpi-icon {
    flex: 0 0 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.3rem;
}
.kpi-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--pac-muted); }
.kpi-value { font-size: 1.65rem; font-weight: 700; line-height: 1.2; margin-top: .2rem; letter-spacing: -.02em; }
.kpi-value small { font-size: .85rem; font-weight: 500; color: var(--pac-muted); margin-left: .2rem; }
.kpi-foot { font-size: .78rem; color: var(--pac-muted); margin-top: .25rem; }
.kpi .progress { height: 5px; margin-top: .55rem; background: var(--pac-surface-2); }

.tone-primary { color: #2456d6; background: rgba(36, 86, 214, .1); }
.tone-info { color: #0e8ea0; background: rgba(22, 163, 184, .12); }
.tone-success { color: #0f9f6e; background: rgba(16, 185, 129, .12); }
.tone-warning { color: #c27803; background: rgba(245, 158, 11, .14); }
.tone-indigo { color: #7045d8; background: rgba(139, 92, 246, .13); }
.tone-danger { color: #d33b3b; background: rgba(239, 68, 68, .12); }
[data-bs-theme="dark"] .tone-primary { color: #7aa2ff; }
[data-bs-theme="dark"] .tone-info { color: #38c7da; }
[data-bs-theme="dark"] .tone-success { color: #34d399; }
[data-bs-theme="dark"] .tone-warning { color: #fbbf24; }
[data-bs-theme="dark"] .tone-indigo { color: #a78bfa; }
[data-bs-theme="dark"] .tone-danger { color: #f87171; }

/* Soft badges */
.badge-soft {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .28rem .6rem; border-radius: 20px;
    font-size: .74rem; font-weight: 600; white-space: nowrap; line-height: 1.2;
}
.badge-soft-primary { color: #1d4ed8; background: rgba(36, 86, 214, .1); }
.badge-soft-info { color: #0b7c8c; background: rgba(22, 163, 184, .13); }
.badge-soft-success { color: #047857; background: rgba(16, 185, 129, .14); }
.badge-soft-warning { color: #a16207; background: rgba(245, 158, 11, .16); }
.badge-soft-indigo { color: #6d28d9; background: rgba(139, 92, 246, .14); }
.badge-soft-danger { color: #b91c1c; background: rgba(239, 68, 68, .12); }
.badge-soft-secondary { color: #475569; background: rgba(100, 116, 139, .13); }
[data-bs-theme="dark"] .badge-soft-primary { color: #93b4ff; }
[data-bs-theme="dark"] .badge-soft-info { color: #5fd4e4; }
[data-bs-theme="dark"] .badge-soft-success { color: #6ee7b7; }
[data-bs-theme="dark"] .badge-soft-warning { color: #fcd34d; }
[data-bs-theme="dark"] .badge-soft-indigo { color: #c4b5fd; }
[data-bs-theme="dark"] .badge-soft-danger { color: #fca5a5; }
[data-bs-theme="dark"] .badge-soft-secondary { color: #cbd5e1; }

.spin { display: inline-block; animation: pac-spin 1s linear infinite; }
@keyframes pac-spin { to { transform: rotate(360deg); } }

/* ---------- Filter bar ---------- */
.filter-bar { padding: 1rem 1.25rem; }
.filter-bar .form-control, .filter-bar .form-select { height: 40px; }
.period-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.period-pills .btn { font-size: .8rem; padding: .3rem .75rem; border-radius: 20px; }

/* ---------- Tables ---------- */
.table-pac { margin: 0; --bs-table-bg: transparent; --bs-table-color: var(--pac-text); }
.table-pac thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
    color: var(--pac-muted); background: var(--pac-surface-2);
    border-bottom: 1px solid var(--pac-border); padding: .75rem 1rem; white-space: nowrap;
}
.table-pac thead th a { color: inherit; display: inline-flex; gap: .25rem; align-items: center; }
.table-pac thead th a:hover { color: var(--pac-primary); }
.table-pac tbody td { padding: .75rem 1rem; vertical-align: middle; border-color: var(--pac-border); }
.table-pac tbody tr { transition: background .12s; }
.table-pac tbody tr:hover { background: var(--pac-surface-2); }
.table-pac tfoot td { padding: .75rem 1rem; font-weight: 600; background: var(--pac-surface-2); border-top: 1px solid var(--pac-border); }
.cell-main { font-weight: 600; color: var(--pac-text); }
.cell-sub { font-size: .76rem; color: var(--pac-muted); }
.cell-clip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86em; }
.route { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; white-space: nowrap; }
.route i { color: var(--pac-muted); font-size: .8rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--pac-muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .75rem; opacity: .5; }

.pagination { --bs-pagination-border-radius: 9px; --bs-pagination-active-bg: var(--pac-primary); --bs-pagination-active-border-color: var(--pac-primary); --bs-pagination-color: var(--pac-text); --bs-pagination-bg: var(--pac-surface); --bs-pagination-border-color: var(--pac-border); margin: 0; }
.pagination .page-link { min-width: 36px; text-align: center; }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }
.legend-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.legend-list li { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.legend-list .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend-list .val { margin-left: auto; font-weight: 600; }
.legend-list .pct { color: var(--pac-muted); font-size: .76rem; width: 3.2rem; text-align: right; }

/* ---------- Tracking ---------- */
.track-hero {
    border-radius: var(--pac-radius);
    padding: 2rem;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(22, 163, 184, .45), transparent 45%),
        linear-gradient(135deg, #0c1a3a 0%, #1e3f99 60%, #2456d6 100%);
    box-shadow: var(--pac-shadow);
}
.track-hero h2 { font-weight: 700; font-size: 1.4rem; }
.track-hero p { color: rgba(255, 255, 255, .75); }
.track-hero .search-lg { display: flex; gap: .5rem; max-width: 680px; }
.track-hero .search-lg input { height: 50px; border-radius: 12px; border: 0; padding-left: 1rem; font-size: 1rem; }
.track-hero .search-lg .btn { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; height: 50px; padding: 0 1.4rem; border-radius: 12px; background: #fff; color: #1e3f99; font-weight: 600; border: 0; }
.track-hero .search-lg .btn:hover { background: #e8eeff; }
@media (max-width: 575.98px) {
    .track-hero { padding: 1.25rem; }
    .track-hero .search-lg { flex-direction: column; }
}

.route-big { display: flex; align-items: center; gap: 1rem; }
.route-big .port { text-align: center; }
.route-big .port strong { display: block; font-size: 1.6rem; letter-spacing: .04em; }
.route-big .port small { color: var(--pac-muted); font-size: .75rem; }
.route-big .line { flex: 1; min-width: 60px; position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--pac-border) 0 8px, transparent 8px 14px); }
.route-big .line i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--pac-primary); background: var(--pac-surface); padding: 0 .35rem; font-size: 1.1rem; }

/* Journey stepper: one segment per event source (Local → Truck → Airline) */
.phase-primary { --phase: #2456d6; --phase-soft: rgba(36, 86, 214, .14); }
.phase-success { --phase: #0f9f6e; --phase-soft: rgba(16, 185, 129, .16); }
.phase-indigo { --phase: #7045d8; --phase-soft: rgba(139, 92, 246, .16); }
.phase-secondary { --phase: #64748b; --phase-soft: rgba(100, 116, 139, .16); }
[data-bs-theme="dark"] .phase-primary { --phase: #5b8cff; }
[data-bs-theme="dark"] .phase-success { --phase: #34d399; }
[data-bs-theme="dark"] .phase-indigo { --phase: #a78bfa; }

.journey { display: flex; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: thin; }
.journey-phase { display: flex; flex-direction: column; flex-basis: 0; min-width: min-content; }
.phase-label {
    display: flex; align-items: center; gap: .4rem;
    margin: 0 .3rem .9rem; padding-bottom: .45rem;
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    color: var(--phase); border-bottom: 2px solid var(--phase-soft);
}
.phase-steps { display: flex; }
.jstep { position: relative; flex: 1 0 80px; text-align: center; padding: 0 .15rem; }
.jstep::before {
    content: ""; position: absolute; top: 20px; left: -50%; width: 100%; height: 3px;
    background: var(--pac-border);
}
.journey-phase:first-child .jstep:first-child::before { display: none; }
.jstep.done::before { background: var(--phase); }
.jstep .dot {
    position: relative; z-index: 1;
    width: 42px; height: 42px; margin: 0 auto .45rem; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.05rem;
    background: var(--pac-surface); color: var(--pac-muted); border: 2px solid var(--pac-border);
}
.jstep.done .dot { background: var(--phase); border-color: var(--phase); color: #fff; }
.jstep.current .dot { box-shadow: 0 0 0 6px var(--phase-soft); }
.jstep .name { font-size: .76rem; font-weight: 600; line-height: 1.25; }
.jstep .when { font-size: .68rem; color: var(--pac-muted); white-space: nowrap; }
@media (max-width: 575.98px) {
    /* Phones: stack the phases and wrap steps into a grid so none hide behind a sideways scroll. */
    .journey { flex-direction: column; gap: 1rem; overflow: visible; }
    .journey-phase { min-width: 0; }
    .phase-steps { display: grid; grid-template-columns: repeat(4, 1fr); row-gap: .9rem; }
    .jstep::before { display: none; }
    .jstep .dot { width: 36px; height: 36px; font-size: .9rem; }
    .jstep .when { white-space: normal; }
}

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--pac-border); }
.timeline li { position: relative; padding: 0 0 1.25rem 2.75rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .t-dot {
    position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; font-size: .9rem; border: 3px solid var(--pac-surface);
}
.timeline .t-title { font-weight: 600; }
.timeline .t-meta { font-size: .78rem; color: var(--pac-muted); }
.timeline li.latest .t-dot { box-shadow: 0 0 0 5px var(--pac-primary-soft); }
.t-no { color: var(--pac-muted); font-weight: 500; font-size: .8rem; margin-right: .35rem; }
.t-group + .t-group { margin-top: 1.4rem; }
.t-group-head {
    display: flex; align-items: center; gap: .45rem;
    margin-bottom: .9rem; padding-bottom: .45rem;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    color: var(--phase); border-bottom: 2px solid var(--phase-soft);
}
.t-group-head .cell-sub { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tone-secondary { color: #475569; background: rgba(100, 116, 139, .13); }
[data-bs-theme="dark"] .tone-secondary { color: #cbd5e1; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem 1.5rem; }
.info-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pac-muted); font-weight: 600; }
.info-grid dd { margin: .15rem 0 0; font-weight: 500; word-break: break-word; }

.result-item { display: flex; gap: 1rem; align-items: center; padding: .9rem 1.25rem; border-bottom: 1px solid var(--pac-border); color: var(--pac-text); }
.result-item:last-child { border-bottom: 0; }
.result-item:hover { background: var(--pac-surface-2); color: var(--pac-text); }

/* ---------- Customers ---------- */
.stat-line { display: flex; gap: .4rem; align-items: center; font-size: .8rem; color: var(--pac-muted); }
.form-section-title { font-size: .95rem; font-weight: 600; display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.form-section-title i { color: var(--pac-primary); }

@media print {
    .pac-sidebar, .pac-topbar, .pac-footer, .no-print { display: none !important; }
    .pac-main { margin: 0 !important; }
    .card-pac { box-shadow: none; }
}
.route-big .line i.bi-airplane-fill { transform: translate(-50%, -50%) rotate(90deg); }
.shipment-no { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.4rem; font-weight: 700; letter-spacing: .02em; }

/* ---------- Security ---------- */
.group-option {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .9rem; border: 1px solid var(--pac-border); border-radius: 10px;
    background: var(--pac-surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.group-option:hover { border-color: var(--pac-primary); }
.group-option:has(input:checked) { border-color: var(--pac-primary); background: var(--pac-primary-soft); }
.group-option:has(input:disabled) { cursor: default; }

.auth-body { min-height: 100vh; }
.auth-shell { display: flex; min-height: 100vh; }
.auth-brand {
    flex: 0 0 42%; max-width: 560px;
    flex-direction: column; justify-content: space-between;
    padding: 3rem; color: #fff;
    background:
        radial-gradient(circle at 80% 15%, rgba(22, 163, 184, .45), transparent 45%),
        linear-gradient(160deg, #0c1a3a 0%, #12306f 55%, #2456d6 100%);
}
.auth-brand .brand-logo { width: 52px; height: 52px; font-size: 1.6rem; margin-bottom: 1.25rem; }
.auth-brand h1 { font-size: 2rem; font-weight: 700; letter-spacing: .08em; margin: 0; }
.auth-brand p { color: rgba(255, 255, 255, .7); margin: .25rem 0 0; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.auth-points li { display: flex; gap: .8rem; align-items: center; font-size: 1rem; color: rgba(255, 255, 255, .88); }
.auth-points i {
    width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .1); font-size: 1.1rem;
}
.auth-brand small { color: rgba(255, 255, 255, .55); }
.auth-main { flex: 1; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card {
    width: 100%; max-width: 420px; padding: 2.25rem;
    background: var(--pac-surface); border: 1px solid var(--pac-border);
    border-radius: 18px; box-shadow: var(--pac-shadow);
}
.auth-card .brand-logo { width: 48px; height: 48px; display: grid; color: #fff; font-size: 1.4rem; }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.auth-card .input-group-text { background: var(--pac-surface-2); color: var(--pac-muted); border-color: var(--pac-border); }
@media (max-width: 575.98px) { .auth-card { padding: 1.5rem; border-radius: 14px; } }

/* ---------- Kendo UI: match the app's typography ----------
   Set through the theme's own variables so every grid part (locked and scrollable tables, popups) uses the
   same size; overriding .k-grid directly lets locked/unlocked row heights drift apart. */
:root {
    --kendo-font-family: var(--bs-body-font-family);
    --kendo-font-size: .875rem;
}
.k-grid { border-radius: 10px; overflow: hidden; }
.k-grid .k-table-th { font-weight: 600; }
