:root {
    --primary: #0b3d91;
    --primary-dark: #082d6c;
    --surface: #ffffff;
    --surface-alt: #f3f6fb;
    --text: #1c2740;
    --muted: #667085;
    --border: #d5ddea;
    --success: #0f9d58;
    --danger: #d92d20;
    --shadow: 0 18px 48px rgba(10, 32, 78, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #eff4fc 0%, #f7f9fc 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.site-shell {
    min-height: 100vh;
}

.topbar {
    padding: 22px 0;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.brand-row,
.admin-header,
.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    justify-content: flex-start;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand-text h1,
.brand-text h2,
.brand-text p {
    margin: 0;
}

.brand-text p,
.muted {
    color: var(--muted);
}

.hero {
    padding: 40px 0 60px;
}

.hero-card,
.card,
.login-card {
    background: var(--surface);
    border: 1px solid rgba(213, 221, 234, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 48px clamp(24px, 4vw, 54px);
    text-align: center;
}

.hero-card h2 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: var(--primary-dark);
}

.hero-card p {
    margin: 0 auto 28px;
    max-width: 650px;
    color: var(--muted);
    line-height: 1.6;
}

.tracking-form,
.table-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.tracking-form input,
.form-control,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tracking-form input {
    max-width: 440px;
}

.tracking-form input:focus,
.form-control:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(11, 61, 145, 0.12);
}

.button,
button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

.button:hover,
button:hover,
.button-link:hover {
    transform: translateY(-1px);
    background: var(--primary-dark);
}

.button.secondary,
.button-link.secondary {
    background: #deebf7;
    color: var(--primary-dark);
}

.login-page .logo {
    height: 105px;
    max-width: 150px;
}

.button.secondary:hover,
.button-link.secondary:hover {
    background: #d7e4fb;
}

.logo {
    height: 200px;   /* control size here */
    width: auto;
    object-fit: contain;
}

.button.danger,
button.danger {
    background: var(--danger);
}

.feature-grid,
.detail-grid,
.form-grid,
.stats-grid {
    display: grid;
    gap: 20px;
}

.feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 28px;
}

.feature-card,
.stat-card,
.meta-item {
    padding: 22px;
    background: #f9fbff;
    border: 1px solid #e4ebf7;
    border-radius: 16px;
}

.meta-item span {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.meta-item strong {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #0B3D91;
}
.feature-card h3,
.stat-card h3,
.stat-card p,
.meta-item span,
.timeline-content h4,
.timeline-content p {
    margin: 0;
}

.feature-card p,
.meta-item span,
.timeline-content p {
    margin-top: 6px;
    color: var(--muted);
}

.results-section,
.admin-shell,
.login-shell {
    padding: 22px 0 52px;
}

.detail-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
}

.card {
    padding: 26px;
}

.section-title {
    margin-top: 0;
    margin-bottom: 18px;
}

.shipment-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(11, 61, 145, 0.1);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.92rem;
}

.timeline {
    display: grid;
    gap: 18px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 14px;
}

.timeline-marker {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-top: 4px;
    background: #c6d3ea;
    border: 4px solid #edf3fd;
}

.timeline-marker::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    width: 2px;
    height: calc(100% + 20px);
    background: #d9e3f6;
    transform: translateX(-50%);
}

.timeline-item:last-child .timeline-marker::after {
    display: none;
}

.timeline-item.completed .timeline-marker,
.timeline-item.current .timeline-marker {
    background: var(--success);
}

.timeline-item.current .timeline-marker {
    box-shadow: 0 0 0 8px rgba(15, 157, 88, 0.14);
}

.timeline-item.pending .timeline-content {
    opacity: 0.62;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid #e7edf7;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
}

.flash.success {
    background: rgba(15, 157, 88, 0.12);
    color: #166534;
}

.flash.error {
    background: rgba(217, 45, 32, 0.12);
    color: #9f1239;
}

.empty-state {
    padding: 28px;
    border: 1px dashed #c9d7ef;
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
    background: #fbfcff;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(480px, calc(100% - 32px));
    padding: 34px;
}

@media (max-width: 900px) {
    .detail-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .brand-row,
    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .hero-card {
        padding: 28px 20px;
    }

    .card,
    .login-card {
        padding: 20px;
    }

    .tracking-form {
        flex-direction: column;
    }

    .tracking-form input,
    .button,
    button,
    .button-link {
        width: 100%;
    }
}
@media (max-width: 768px) {
    .brand-row {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .brand {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .logo {
        display: block;
        margin: 0 auto 10px auto;
    }
}

/* Fix Contact button width on mobile */
@media (max-width: 768px) {
    .button {
        width: auto;
        display: inline-block;
        padding: 10px 30px;
    }
}