/* ==========================================================================
   LMC – Cargo & Logistics Authority · light theme
   Brand blue #0000CC · tints #3333D6 #5D5DDF #BCBCF2 #F2F2FC
   ========================================================================== */
:root {
  --brand: #0000CC;
  --brand-dark: #0000A3;
  --brand-2: #5D5DDF;
  --brand-tint: #F2F2FC;
  --brand-line: #BCBCF2;
  /* legacy names kept so existing markup keeps working */
  --navy: #14182B;
  --navy-2: #0000A3;
  --blue: #0000CC;
  --blue-soft: #F2F2FC;
  --orange: #0000CC;
  --orange-dark: #0000CC;
  --grey: #F7F8FA;
  --line: #E6E8EE;
  --text: #2B3044;
  --muted: #6B7185;
  --success: #12805C;
  --danger: #C62B3B;
  --warning: #B7791F;
  --radius: 8px;
  --shadow: none;
  --sidebar-w: 248px;
  --bs-primary: #0000CC;
  --bs-primary-rgb: 0,0,204;
  --bs-body-color: #2B3044;
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-link-color: #0000CC;
  --bs-link-color-rgb: 0,0,204;
  --bs-link-hover-color: #0000A3;
  --bs-link-hover-color-rgb: 0,0,163;
}
body { background: var(--grey); color: var(--text); font-size: .9rem; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,.h1,.h2,.h3,.h4,.h5 { color: var(--navy); font-weight: 600; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.text-navy { color: var(--navy) !important; }
.text-orange, .text-brand { color: var(--brand) !important; }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.bg-navy { background: var(--brand) !important; }
.bg-blue-soft { background: var(--brand-tint) !important; }
.fw-600 { font-weight: 600; }
.small-caps { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--muted); }

/* Buttons – flat */
.btn { border-radius: 6px; font-weight: 500; padding: .48rem 1rem; box-shadow: none !important; }
.btn-sm { padding: .28rem .65rem; font-size: .8rem; }
.btn-primary, .btn-orange { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-orange:hover, .btn-orange:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand-line); background: #fff; }
.btn-outline-primary:hover { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; border-color: var(--line); color: var(--text); }
.btn-light:hover { background: var(--grey); border-color: #d5d9e2; }

/* Forms */
.form-control, .form-select { border-radius: 6px; border-color: #D5D9E2; padding: .5rem .75rem; font-size: .88rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,0,204,.12); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; font-size: .82rem; color: var(--navy); margin-bottom: .3rem; }
.form-text { color: var(--muted); font-size: .78rem; }
.required::after { content: " *"; color: var(--danger); }
.form-section { border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: 1.25rem; }
.form-section-title { font-size: .92rem; font-weight: 600; color: var(--navy); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.form-section-title i { color: var(--brand); }

/* Cards */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.card-header { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1.1rem; font-weight: 600; color: var(--navy); border-radius: var(--radius) var(--radius) 0 0 !important; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-body { padding: 1.1rem; }

/* Stat tiles */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1rem; display: flex; gap: .85rem; align-items: center; height: 100%; color: var(--text); }
a.stat:hover { border-color: var(--brand-line); }
.stat-icon { width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; font-size: 1rem; flex-shrink: 0; background: var(--brand-tint); color: var(--brand); }
.stat-value { font-size: 1.35rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-label { font-size: .76rem; color: var(--muted); font-weight: 500; }
.tone-blue .stat-icon, .tone-navy .stat-icon, .tone-purple .stat-icon, .tone-orange .stat-icon { background: var(--brand-tint); color: var(--brand); }
.tone-green .stat-icon { background: #E8F5EF; color: var(--success); }
.tone-red .stat-icon { background: #FBEAEC; color: var(--danger); }

/* Tables */
.table { --bs-table-color: var(--text); margin-bottom: 0; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #FAFBFC; border-bottom: 1px solid var(--line); white-space: nowrap; padding: .65rem .85rem; }
.table > tbody td { padding: .7rem .85rem; vertical-align: middle; border-color: #EFF1F5; }
.table-hover > tbody > tr:hover > * { background: #FAFAFE; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; font-size: .8rem; color: var(--brand); letter-spacing: .01em; }

/* Badges */
.badge { font-weight: 500; padding: .35em .6em; border-radius: 4px; }
.badge-soft { background: var(--brand-tint); color: var(--brand); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.source-gps { background: #E8F5EF; color: #0E6B4C; }
.source-reported { background: #FFF6E5; color: #8A5A10; }

/* App shell – white sidebar */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line); color: var(--text); z-index: 1040; display: flex; flex-direction: column; transition: transform .2s ease; }
.sidebar-brand { padding: 1rem 1.1rem; display: flex; align-items: center; gap: .65rem; color: var(--navy); border-bottom: 1px solid var(--line); height: 60px; }
.brand-mark { width: 34px; height: 34px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; letter-spacing: .02em; flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: .92rem; line-height: 1.15; color: var(--navy); }
.brand-sub { font-size: .68rem; letter-spacing: .02em; color: var(--muted); }
.sidebar-nav { overflow-y: auto; padding: .6rem .6rem 2rem; flex: 1; }
.nav-section { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: #9096A8; padding: .9rem .7rem .35rem; font-weight: 600; }
.sidebar .nav-link { color: #3D4359; border-radius: 6px; padding: .45rem .7rem; display: flex; align-items: center; gap: .65rem; font-weight: 500; font-size: .86rem; margin-bottom: 1px; }
.sidebar .nav-link i { width: 18px; text-align: center; color: #8A90A3; }
.sidebar .nav-link:hover { background: var(--grey); color: var(--navy); }
.sidebar .nav-link.active { background: var(--brand-tint); color: var(--brand); }
.sidebar .nav-link.active i { color: var(--brand); }
.sidebar .nav-link .badge { margin-left: auto; }
.sidebar-footer { padding: .8rem 1.1rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); height: 60px; display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem; position: sticky; top: 0; z-index: 1030; }
.topbar .portal-label { font-size: .74rem; font-weight: 500; color: var(--muted); }
.content { padding: 1.5rem; flex: 1; }
.page-header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.3rem; margin: 0; }
.page-header .subtitle { color: var(--muted); margin-top: .2rem; }
.breadcrumb { font-size: .78rem; margin-bottom: .3rem; }
.icon-btn { width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--text); position: relative; }
.icon-btn .count { position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 600; border-radius: 10px; padding: 2px 5px; min-width: 18px; text-align: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .8rem; }
.notif-menu { width: 360px; max-height: 440px; overflow-y: auto; padding: 0; }
.notif-item { padding: .7rem 1rem; border-bottom: 1px solid #F0F2F5; display: block; color: var(--text); white-space: normal; }
.notif-item.unread { background: var(--brand-tint); }
.notif-item:hover { background: #ECECFB; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-size: .75rem; font-weight: 600; }
.lang-switch a { padding: .3rem .55rem; color: var(--muted); background: #fff; }
.lang-switch a.active { background: var(--brand); color: #fff; }
.public-nav .lang-switch { border-color: var(--line); }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(20,24,43,.35); z-index: 1035; }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
}

/* Detail lists */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem 1.5rem; }
.dl-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; margin-bottom: .15rem; }
.dl-grid dd { margin: 0; font-weight: 500; color: var(--navy); word-break: break-word; }

/* Movement timeline */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 1.2rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -1.6rem; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.tl-item.superseded { opacity: .55; }
.tl-item.superseded .tl-title { text-decoration: line-through; }
.tl-title { font-weight: 600; color: var(--navy); }
.tl-meta { font-size: .78rem; color: var(--muted); }

/* Corridor route progress (vertical checkpoint list) */
.route-progress { list-style: none; margin: 0; padding: 0; position: relative; }
.rp-item { position: relative; display: flex; gap: .8rem; padding: 0 0 .95rem 0; }
.rp-item:last-child { padding-bottom: 0; }
.rp-item::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.rp-item:last-child::before { display: none; }
.rp-item.done::before { background: var(--brand); }
.rp-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C5CAD6; background: #fff; flex-shrink: 0; margin-top: 3px; position: relative; z-index: 1; }
.rp-item.done .rp-dot { background: var(--brand); border-color: var(--brand); }
.rp-item.next .rp-dot { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0,0,204,.15); }
.rp-item.skipped .rp-dot { border-style: dashed; }
.rp-name { font-weight: 600; color: var(--navy); font-size: .86rem; line-height: 1.3; }
.rp-item:not(.done):not(.next) .rp-name { color: #6B7185; font-weight: 500; }
.rp-meta { font-size: .75rem; color: var(--muted); }

/* Corridor picker on the cargo form */
.corridor-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem; }
.corridor-option { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 6px; padding: .7rem .8rem; cursor: pointer; background: #fff; }
.corridor-option:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.corridor-option input { margin-top: .2rem; accent-color: var(--brand); }
.corridor-option strong { display: block; font-size: .85rem; color: var(--navy); font-weight: 600; }
.corridor-option small { display: block; color: var(--muted); font-size: .74rem; line-height: 1.4; margin-top: .15rem; }

/* Public progress tracker */
.progress-track { display: flex; justify-content: space-between; position: relative; margin: 1.5rem 0 .5rem; }
.progress-track::before { content: ""; position: absolute; top: 18px; left: 6%; right: 6%; height: 2px; background: var(--line); }
.progress-track .bar { position: absolute; top: 18px; left: 6%; height: 2px; background: var(--brand); }
.pt-step { position: relative; text-align: center; flex: 1; z-index: 1; }
.pt-icon { width: 38px; height: 38px; margin: 0 auto .45rem; border-radius: 50%; background: #fff; border: 2px solid #D5D9E2; display: grid; place-items: center; color: #A0A6B6; font-size: .85rem; }
.pt-step.done .pt-icon { border-color: var(--brand); background: var(--brand); color: #fff; }
.pt-step.current .pt-icon { border-color: var(--brand); background: #fff; color: var(--brand); box-shadow: 0 0 0 4px rgba(0,0,204,.12); }
.pt-label { font-size: .74rem; font-weight: 500; color: var(--muted); }
.pt-step.done .pt-label, .pt-step.current .pt-label { color: var(--navy); }
@media (max-width: 767.98px) {
  .progress-track { flex-direction: column; gap: .6rem; }
  .progress-track::before, .progress-track .bar { display: none; }
  .pt-step { display: flex; align-items: center; gap: .75rem; text-align: left; }
  .pt-icon { margin: 0; width: 32px; height: 32px; }
}

/* Maps */
.map { height: 420px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.map-sm { height: 300px; }
.map-lg { height: calc(100vh - 230px); min-height: 480px; }
.leaflet-popup-content { font-size: .82rem; }
.map-legend { background: #fff; padding: .45rem .65rem; border-radius: 6px; border: 1px solid var(--line); font-size: .75rem; line-height: 1.7; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.photo-grid a { display: block; aspect-ratio: 4/3; border-radius: 6px; overflow: hidden; background: #E9ECF2; position: relative; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .vis { position: absolute; bottom: 4px; left: 4px; font-size: .62rem; }

/* Public site – white header, plain sections */
.public-nav { background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 0; }
.public-nav .brand-name { color: var(--navy); }
.public-nav .nav-link { color: #3D4359; font-weight: 500; padding: .5rem .85rem !important; }
.public-nav .nav-link:hover, .public-nav .nav-link.active { color: var(--brand); }
.public-nav .navbar-toggler { border-color: var(--line); }
.hero { background: #fff; color: var(--text); padding: 3.5rem 0; border-bottom: 1px solid var(--line); }
.hero h1 { color: var(--navy); font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
.hero .lead { color: var(--muted); font-size: 1.05rem; }
.hero .text-white, .hero .text-white-50 { color: var(--muted) !important; }
.eyebrow { display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin-bottom: .6rem; }
.track-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem; color: var(--text); }
.track-box h2 { font-size: 1.05rem; letter-spacing: 0; }
.track-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; padding: .75rem .9rem; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; height: 100%; }
.feature i { font-size: 1.1rem; color: var(--brand); background: var(--brand-tint); width: 42px; height: 42px; border-radius: 6px; display: grid; place-items: center; margin-bottom: .85rem; }
.section { padding: 3rem 0; }
.section-title { font-size: 1.5rem; font-weight: 700; }
.public-footer { background: #fff; border-top: 1px solid var(--line); color: var(--muted); padding: 2.5rem 0 1.25rem; font-size: .85rem; }
.public-footer a { color: var(--text); }
.public-footer a:hover { color: var(--brand); }
.public-footer h6 { color: var(--navy); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.public-footer .border-secondary { border-color: var(--line) !important; }
.corridor-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.1rem; height: 100%; }
.corridor-card h3 { font-size: 1rem; margin-bottom: .35rem; }
.corridor-stops { display: flex; flex-wrap: wrap; gap: .3rem .35rem; font-size: .78rem; color: var(--muted); }
.corridor-stops span::after { content: "→"; margin-left: .35rem; color: #B0B5C4; }
.corridor-stops span:last-child::after { content: ""; }
.corridor-stops .b { color: var(--brand); font-weight: 600; }
.verify-banner { border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; gap: 1rem; align-items: center; }
.verify-banner.ok { background: #E8F5EF; border: 1px solid #BFE3D2; color: #0E5A40; }
.verify-banner.warn { background: #FFF6E5; border: 1px solid #F1D9AA; color: #7A4E0E; }
.verify-banner i { font-size: 1.5rem; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--brand); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2, .auth-side .brand-name { color: #fff; }
.auth-side .brand-mark { background: #fff; color: var(--brand); }
.auth-side .brand-sub, .auth-side .text-white-50 { color: rgba(255,255,255,.75) !important; }
.auth-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.auth-form > div { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

.empty-state { text-align: center; padding: 2.25rem 1rem; color: var(--muted); }
.empty-state i { font-size: 1.7rem; color: #C5CAD6; margin-bottom: .7rem; display: block; }
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; margin-bottom: 1rem; }
.alert { border-radius: 6px; border: 1px solid transparent; }
.alert-success { background: #E8F5EF; border-color: #BFE3D2; color: #0E5A40; }
.alert-danger { background: #FBEAEC; border-color: #F2C3C8; color: #8E1F2B; }
.alert-info { background: var(--brand-tint); border-color: var(--brand-line); color: #00007A; }
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { color: var(--muted); font-weight: 500; border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--brand); }
.kv-table td:first-child { color: var(--muted); width: 40%; font-weight: 500; font-size: .82rem; }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .main { margin: 0; } }
.auth-side .eyebrow { color: rgba(255,255,255,.8); }
.corridor-map { height: 360px; }
.public-nav .nav-link { white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1199.98px) { .public-nav .nav-link { padding: .5rem .5rem !important; font-size: .85rem; } .public-nav .brand-sub { display: none !important; } }
.brand-mark { font-size: .72rem; }
