:root {
    --ems-navy: #08213f;
    --ems-blue: #1356d4;
    --ems-red: #d72638;
    --ems-gold: #f4b000;
    --ems-ink: #172033;
    --ems-muted: #667085;
    --ems-line: #d9e2ef;
    --ems-soft: #f4f7fb;
    --ems-shadow: 0 18px 50px rgba(8, 33, 63, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    color: var(--ems-ink);
    background: #fff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}
a { text-decoration: none; }
.btn, .form-control, .form-select, .card, .alert, .modal-content { border-radius: 8px; }
.btn-primary {
    --bs-btn-bg: var(--ems-red);
    --bs-btn-border-color: var(--ems-red);
    --bs-btn-hover-bg: #b91d2e;
    --bs-btn-hover-border-color: #b91d2e;
}
.btn-outline-primary {
    --bs-btn-color: var(--ems-blue);
    --bs-btn-border-color: var(--ems-blue);
    --bs-btn-hover-bg: var(--ems-blue);
    --bs-btn-hover-border-color: var(--ems-blue);
}
.ems-navbar {
    background: linear-gradient(90deg, #061a33, #0b2f62);
    border-bottom: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 12px 34px rgba(8, 33, 63, .18);
}
.ems-navbar .nav-link {
    color: rgba(255,255,255,.82);
    font-weight: 700;
}
.ems-navbar .nav-link:hover,
.ems-navbar .nav-link:focus {
    color: #fff;
}
.ems-navbar .navbar-toggler {
    border-color: rgba(255,255,255,.35);
}
.brand-badge {
    display: inline-grid;
    min-width: 46px;
    min-height: 36px;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    background: linear-gradient(135deg, var(--ems-red), var(--ems-blue));
    font-weight: 900;
}
.brand-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 850;
}
.brand-logo-link:hover,
.brand-logo-link:focus {
    color: #fff;
}
.brand-logo {
    display: block;
    width: 118px;
    height: 52px;
    object-fit: contain;
    border-radius: 6px;
}
.admin-logo {
    width: 74px;
    height: 48px;
}
.eyebrow {
    color: var(--ems-red);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.hero-section {
    position: relative;
    padding: 96px 0 86px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(8, 33, 63, .95), rgba(19, 86, 212, .72)),
        url("https://images.unsplash.com/photo-1494412685616-a5d310fbb07d?auto=format&fit=crop&w=1800&q=80") center/cover;
}
.hero-logistics {
    min-height: 720px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(90deg, rgba(8, 33, 63, .94), rgba(8, 33, 63, .60)),
        url("https://images.unsplash.com/photo-1601584115197-04ecc0da31d7?auto=format&fit=crop&w=1900&q=80") center/cover;
}
.hero-section h1 {
    max-width: 850px;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: .98;
    font-weight: 900;
}
.hero-section .lead { max-width: 720px; color: rgba(255,255,255,.78); }
.hero-photo-card {
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
}
.hero-photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.hero-photo-card figcaption {
    display: grid;
    gap: 12px;
    padding: 18px;
    color: var(--ems-ink);
}
.hero-photo-card figcaption strong {
    font-size: 1.05rem;
}
.page-hero {
    padding: 120px 0 92px;
    color: #fff;
}
.page-hero h1 {
    max-width: 960px;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 1;
    font-weight: 900;
}
.page-hero .lead {
    max-width: 760px;
    color: rgba(255,255,255,.78);
}
.services-hero {
    background:
        linear-gradient(90deg, rgba(8, 33, 63, .94), rgba(19, 86, 212, .56)),
        url("https://images.unsplash.com/photo-1494412651409-8963ce7935a7?auto=format&fit=crop&w=1900&q=80") center/cover;
}
.contact-hero {
    background:
        linear-gradient(90deg, rgba(8, 33, 63, .95), rgba(8, 33, 63, .58)),
        url("https://images.unsplash.com/photo-1553413077-190dd305871c?auto=format&fit=crop&w=1900&q=80") center/cover;
}
.section-photo {
    display: block;
    width: 100%;
    min-height: 360px;
    max-height: 560px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--ems-shadow);
}
.tracking-preview, .feature-panel, .service-card, .quote, .tracking-search, .detail-panel, .contact-form, .admin-panel, .admin-stat, .login-card {
    border: 1px solid rgba(217, 226, 239, .85);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--ems-shadow);
}
.tracking-preview {
    padding: 24px;
    color: var(--ems-ink);
}
.mini-map {
    height: 210px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(19,86,212,.15), rgba(215,38,56,.12)),
        repeating-linear-gradient(45deg, transparent 0 18px, rgba(8,33,63,.08) 19px 20px);
    position: relative;
}
.mini-map::after {
    content: "";
    position: absolute;
    left: 18%;
    top: 45%;
    width: 64%;
    height: 4px;
    background: var(--ems-red);
    box-shadow: 0 0 0 6px rgba(215,38,56,.12);
}
.section { padding: 76px 0; }
.bg-soft { background: var(--ems-soft); }
.section-heading { max-width: 760px; margin-bottom: 32px; }
.section-heading h1, .section-heading h2 { font-weight: 850; color: var(--ems-navy); }
.feature-panel, .service-card, .quote, .detail-panel, .contact-form, .admin-panel { padding: 24px; }
.service-card {
    transition: transform 180ms ease, box-shadow 180ms ease;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 70px rgba(8, 33, 63, .16);
}
.service-card i {
    display: inline-grid;
    width: 54px;
    height: 54px;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 8px;
    color: #fff;
    background: var(--ems-blue);
    font-size: 1.45rem;
}
.service-card h3, .service-card h2 { font-size: 1.1rem; color: var(--ems-navy); font-weight: 800; }
.service-card p, .feature-panel p, .quote { color: var(--ems-muted); }
.service-card-photo {
    overflow: hidden;
    padding: 0;
}
.service-card-photo > img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.service-card-body {
    padding: 24px;
}
.image-service {
    overflow: hidden;
    border: 1px solid rgba(217, 226, 239, .85);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--ems-shadow);
}
.image-service img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.image-service div {
    padding: 18px;
}
.image-service h3 {
    margin-bottom: 8px;
    color: var(--ems-navy);
    font-size: 1.05rem;
    font-weight: 850;
}
.image-service p {
    margin: 0;
    color: var(--ems-muted);
    font-size: .94rem;
}
.stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--ems-line);
}
.stats-strip div {
    padding: 28px;
    background: #fff;
}
.stats-strip strong {
    display: block;
    color: var(--ems-navy);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}
.stats-strip span { color: var(--ems-muted); font-weight: 700; }
.quote { height: 100%; font-weight: 650; }
.quote span { display: block; margin-top: 18px; color: var(--ems-red); font-size: .9rem; }
.footer { color: #fff; background: var(--ems-navy); }
.footer a { display: block; color: rgba(255,255,255,.75); margin-top: 8px; }
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 20;
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--ems-red);
}
.back-to-top.visible { display: inline-grid; place-items: center; }
.tracking-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    gap: 28px;
    align-items: center;
    padding: 28px;
}
.tracking-form {
    display: flex;
    gap: 10px;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #7a4d00;
    background: #fff4cf;
    font-weight: 800;
}
.status-pending {
    color: #7a4d00;
    background: #fff4cf;
}
.status-in-transit {
    color: #0b4a7a;
    background: #dff1ff;
}
.status-customs-clearance {
    color: #6b3d8f;
    background: #f1e4ff;
}
.status-arrived-at-hub {
    color: #075985;
    background: #e0f2fe;
}
.status-out-for-delivery {
    color: #9a3412;
    background: #ffedd5;
}
.status-delivered {
    color: #116149;
    background: #dff7ec;
}
.small-badge { padding: 5px 9px; font-size: .78rem; }
.shipment-meta { display: grid; gap: 12px; margin: 20px 0 0; }
.shipment-meta div { padding-bottom: 10px; border-bottom: 1px solid var(--ems-line); }
.shipment-meta dt { color: var(--ems-muted); font-size: .8rem; text-transform: uppercase; }
.shipment-meta dd { margin: 2px 0 0; font-weight: 700; }
.progress-lg { height: 14px; }
.progress-bar { background: linear-gradient(90deg, var(--ems-blue), var(--ems-red)); }
.progress-pending { background: linear-gradient(90deg, #f59e0b, #f4b000); }
.progress-in-transit { background: linear-gradient(90deg, #0ea5e9, #1356d4); }
.progress-customs-clearance { background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.progress-arrived-at-hub { background: linear-gradient(90deg, #0284c7, #0369a1); }
.progress-out-for-delivery { background: linear-gradient(90deg, #f97316, #d72638); }
.progress-delivered { background: linear-gradient(90deg, #10b981, #15803d); }
.status-rail {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}
.status-rail div { display: grid; gap: 8px; justify-items: center; text-align: center; color: var(--ems-muted); }
.status-rail span {
    width: 22px;
    height: 22px;
    border: 3px solid var(--ems-line);
    border-radius: 50%;
    background: #fff;
}
.status-rail .done span { border-color: var(--ems-blue); background: var(--ems-blue); }
.status-rail .current span { border-color: var(--ems-red); background: var(--ems-red); box-shadow: 0 0 0 8px rgba(215,38,56,.13); }
.status-rail .current.status-pending span { border-color: #f59e0b; background: #f59e0b; box-shadow: 0 0 0 8px rgba(245,158,11,.16); }
.status-rail .current.status-in-transit span { border-color: #0ea5e9; background: #0ea5e9; box-shadow: 0 0 0 8px rgba(14,165,233,.16); }
.status-rail .current.status-customs-clearance span { border-color: #8b5cf6; background: #8b5cf6; box-shadow: 0 0 0 8px rgba(139,92,246,.16); }
.status-rail .current.status-arrived-at-hub span { border-color: #0284c7; background: #0284c7; box-shadow: 0 0 0 8px rgba(2,132,199,.16); }
.status-rail .current.status-out-for-delivery span { border-color: #f97316; background: #f97316; box-shadow: 0 0 0 8px rgba(249,115,22,.16); }
.status-rail .current.status-delivered span,
.status-rail .done.status-delivered span { border-color: #10b981; background: #10b981; box-shadow: 0 0 0 8px rgba(16,185,129,.16); }
.timeline {
    position: relative;
    display: grid;
    gap: 18px;
    margin-top: 22px;
    padding-left: 24px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--ems-line);
}
.timeline article {
    position: relative;
    padding: 16px 18px;
    border: 1px solid var(--ems-line);
    border-radius: 8px;
    background: #fff;
}
.timeline article::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ems-muted);
}
.timeline article.completed::before { background: var(--ems-blue); }
.timeline time { color: var(--ems-muted); font-size: .82rem; }
.timeline h3, .timeline h4 { margin: 4px 0; font-size: 1rem; color: var(--ems-navy); }
.timeline p { margin: 0; color: var(--ems-muted); }
.contact-tile {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--ems-line);
    font-weight: 700;
}
.contact-tile i { color: var(--ems-red); font-size: 1.2rem; }
.auth-page {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(8,33,63,.90), rgba(8,33,63,.65)),
        url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=1800&q=80") center/cover;
}
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card { width: min(100%, 460px); padding: 32px; }
.admin-body { background: var(--ems-soft); }
.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}
.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 24px;
    color: #fff;
    background: var(--ems-navy);
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-weight: 850;
}
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,.82);
}
.admin-sidebar nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.admin-main { padding: 28px; min-width: 0; }
.admin-stat {
    display: grid;
    gap: 8px;
    padding: 20px;
}
.admin-stat i { color: var(--ems-red); font-size: 1.35rem; }
.admin-stat span { color: var(--ems-muted); font-weight: 700; }
.admin-stat strong { color: var(--ems-navy); font-size: 2rem; line-height: 1; }
.stage-list { display: grid; gap: 12px; }
.stage-editor {
    padding: 14px;
    border: 1px solid var(--ems-line);
    border-radius: 8px;
    background: var(--ems-soft);
}
.form-label { width: 100%; font-weight: 700; color: var(--ems-ink); }

@media (max-width: 992px) {
    .tracking-search { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static;
        height: auto;
    }
    .stats-strip { grid-template-columns: repeat(2, 1fr); }
    .hero-logistics { min-height: auto; }
}
@media (max-width: 680px) {
    .hero-section { padding: 70px 0; }
    .page-hero { padding: 82px 0 64px; }
    .section-photo { min-height: 260px; }
    .tracking-form { flex-direction: column; }
    .status-rail { grid-template-columns: repeat(2, 1fr); }
    .stats-strip { grid-template-columns: 1fr; }
    .admin-main { padding: 18px; }
}
