/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f4f8;
    color: #1a2332;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* ── Color Palette ────────────────────────────────────────── */
:root {
    --primary: #0052cc;
    --primary-dark: #003d99;
    --primary-light: #e8f0fe;
    --accent: #00b894;
    --accent-light: #e6faf5;
    --bg: #f0f4f8;
    --card: #ffffff;
    --text: #1a2332;
    --text-secondary: #5e6c84;
    --text-muted: #97a0af;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    --radius: 12px;
    --radius-lg: 20px;
}

/* ── Brand Colors by Status ───────────────────────────────── */
.status-processed { --status-color: #6366f1; --status-bg: #eef2ff; }
.status-collected { --status-color: #3b82f6; --status-bg: #eff6ff; }
.status-transit { --status-color: #f59e0b; --status-bg: #fffbeb; }
.status-customs { --status-color: #8b5cf6; --status-bg: #f5f3ff; }
.status-out-delivery { --status-color: #06b6d4; --status-bg: #ecfeff; }
.status-delivered { --status-color: #10b981; --status-bg: #ecfdf5; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,.92);
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.nav-brand svg { color: var(--primary); }
.nav-links { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 18px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-link.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }
.admin-link {
    border: 1.5px solid var(--border);
    padding: 6px 16px;
}
.logout-link { color: #ef4444; }
.logout-link:hover { background: #fef2f2; color: #dc2626; }

/* ── Admin Navbar ────────────────────────────────────────── */
.admin-navbar {
    background: var(--text);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-navbar .nav-brand { color: #fff; }
.admin-navbar .nav-link { color: #94a3b8; }
.admin-navbar .nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.admin-navbar .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    padding: 80px 24px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #f0f4f8 0%, #fff 100%);
}
.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0,82,204,.06) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content { max-width: 680px; margin: 0 auto; position: relative; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
}
.hero-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.hero-title span { color: var(--primary); }
.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.7;
}

/* ── Search Box ──────────────────────────────────────────── */
.search-box {
    display: flex;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    max-width: 580px;
    margin: 0 auto;
    border: 2px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,82,204,.12), var(--shadow-md);
}
.search-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    margin: 16px 0 16px 20px;
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 16px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s;
    letter-spacing: .3px;
}
.search-btn:hover { background: var(--primary-dark); }

/* ── Trust Badges ────────────────────────────────────────── */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 24px 0 56px;
    flex-wrap: wrap;
}
.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.trust-badge svg { color: var(--accent); }

/* ── Steps Section ───────────────────────────────────────── */
.steps-section {
    padding: 56px 24px;
    background: #fff;
}
.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.section-subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}
.steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
}
.step {
    text-align: center;
    flex: 1;
    max-width: 240px;
}
.step-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    font-weight: 700;
    transition: transform .2s;
}
.step:hover .step-icon { transform: scale(1.05); }
.step h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.step p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.step-arrow { flex-shrink: 0; padding: 20px 20px 0; color: var(--text-muted); }

/* ── Features Section ────────────────────────────────────── */
.features-section { padding: 56px 24px; background: var(--bg); }
.features-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
}
.feature-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    background: var(--text);
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 12px; }
.footer-links a { color: #94a3b8; font-size: 13px; }
.footer-links a:hover { color: #fff; }

/* ── Result Page ─────────────────────────────────────────── */
.result-section {
    padding: 32px 24px 56px;
    background: var(--bg);
    min-height: calc(100vh - 64px);
}
.result-search-form {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.result-search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,82,204,.1);
}
.result-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 18px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
}
.result-search-input::placeholder { color: var(--text-muted); }
.result-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.result-header {
    padding: 28px 32px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}
.tracking-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .8px;
}
.tracking-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 1px;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.status-badge.sm { padding: 4px 12px; font-size: 12px; }

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar-section {
    display: flex;
    padding: 32px 24px 28px;
    justify-content: center;
    overflow-x: auto;
    gap: 0;
}
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 90px;
    flex: 1;
}
.progress-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8ecf1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: all .35s ease;
}
.progress-step.completed .progress-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}
.progress-step.current .progress-dot {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,82,204,.15);
}
.dot-inner { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.progress-line {
    position: absolute;
    top: 14px;
    left: calc(50% + 14px);
    width: calc(100% - 28px);
    height: 3px;
    background: #e8ecf1;
    z-index: 0;
    border-radius: 2px;
}
.progress-step:last-child .progress-line { display: none; }
.progress-step.completed .progress-line { background: var(--accent); }
.progress-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    transition: color .2s;
}
.progress-step.completed .progress-label { color: var(--accent); font-weight: 600; }
.progress-step.current .progress-label { color: var(--primary); font-weight: 700; }

/* ── Info Grid ───────────────────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 0;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
}
.info-item {
    padding: 8px 20px 8px 0;
    border-right: 1px solid var(--border);
}
.info-item:last-child { border-right: none; }
.info-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.info-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}

/* ── Party Grid ──────────────────────────────────────────── */
.party-grid {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
}
.party-card {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg);
    border-radius: var(--radius);
}
.party-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}
.party-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.party-address { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.party-arrow { flex-shrink: 0; color: var(--primary); }
.description-box {
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
}
.description-box p { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ── Timeline ────────────────────────────────────────────── */
.timeline-title {
    padding: 24px 32px 16px;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.timeline-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}
.timeline {
    padding: 8px 32px 32px;
}
.timeline-item {
    display: flex;
    gap: 16px;
    position: relative;
    padding-bottom: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #d0d5dd;
    background: #fff;
    margin-top: 6px;
    position: relative;
    z-index: 1;
    transition: border-color .2s;
}
.timeline-item.latest .timeline-marker {
    width: 18px;
    height: 18px;
    margin-top: 4px;
    border-width: 4px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 20px;
    bottom: 0;
    width: 2px;
    background: #e8ecf1;
}
.timeline-item:last-child::before { display: none; }
.timeline-item.latest::before { left: 8px; }
.marker-glow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    opacity: .15;
    position: absolute;
    top: -6px;
    left: -6px;
}
.timeline-card {
    flex: 1;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px 18px;
    transition: box-shadow .2s;
}
.timeline-item.latest .timeline-card {
    background: #fff;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 12px;
}
.timeline-status { font-size: 14px; font-weight: 600; }
.timeline-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.timeline-location {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.timeline-desc { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.delete-event-form { margin-top: 8px; }
.btn-text-danger {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}
.btn-text-danger:hover { text-decoration: underline; }

/* ── Not Found ───────────────────────────────────────────── */
.not-found-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 64px 32px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.not-found-icon { margin-bottom: 16px; }
.not-found-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.not-found-card p { color: var(--text-secondary); font-size: 15px; margin-bottom: 8px; }
.not-found-hint { font-size: 13px !important; color: var(--text-muted) !important; }
.not-found-card .btn { margin-top: 24px; display: inline-block; }

/* ── Flash Messages ──────────────────────────────────────── */
.flash-container { max-width: 780px; margin: 16px auto 0; padding: 0 24px; }
.flash-message {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 12px;
    animation: flashIn .3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.flash-message.success { background: var(--accent-light); color: #0b7b5e; border: 1px solid #a7f3d0; }
.flash-message.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-message.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-message.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all .2s;
    gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text-secondary); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-full { width: 100%; }
.btn-icon {
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 6px;
    transition: background .2s;
}
.btn-icon:hover { background: var(--bg); }

/* ── Admin Styles ────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e293b);
}
.login-container { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-header svg { margin-bottom: 12px; }
.login-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.login-header p { font-size: 14px; color: var(--text-secondary); }
.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}
.back-link:hover { color: var(--primary); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,82,204,.1); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section { margin-bottom: 8px; }
.form-section h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.form-divider { height: 1px; background: var(--border); margin: 20px 0; }
.form-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.delete-section { margin-top: 16px; text-align: right; }

/* ── Admin Main ──────────────────────────────────────────── */
.admin-main {
    padding: 32px 0 64px;
    background: var(--bg);
    min-height: calc(100vh - 64px);
}
.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: -16px;
    margin-bottom: 24px;
}

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
}
.stat-number { display: block; font-size: 28px; font-weight: 700; color: var(--text); }
.stat-label { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.stat-action { display: block; font-size: 14px; font-weight: 600; color: #8b5cf6; padding-top: 14px; }
.stat-action:hover { text-decoration: underline; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 16px; font-weight: 600; color: var(--text); }

/* ── Data Table ──────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }
.tracking-link { color: var(--primary); font-weight: 600; }
.tracking-link:hover { text-decoration: underline; }
.actions-cell { white-space: nowrap; }
.empty-row { text-align: center; padding: 40px !important; color: var(--text-muted); }
.empty-row a { color: var(--primary); }

/* ── Detail Header ───────────────────────────────────────── */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.detail-header .back-btn {
    display: inline-block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.detail-header .back-btn:hover { color: var(--primary); }
.detail-header .page-title { margin-bottom: 8px; }
.detail-actions { display: flex; gap: 8px; }

/* ── Detail Grid ─────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px;
}
.detail-block h4 {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.detail-name { font-size: 16px; font-weight: 600; }
.detail-addr { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.detail-route { font-size: 16px; font-weight: 600; color: var(--primary); }
.detail-value { font-size: 20px; font-weight: 700; }
.detail-desc { padding: 0 24px 24px; }
.detail-desc h4 { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.detail-desc p { font-size: 14px; color: var(--text-secondary); }
.recent-deliveries { padding: 16px 24px; }
.delivery-item {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.delivery-item:last-child { border-bottom: none; }
.delivery-item strong { min-width: 140px; color: var(--primary); }
.delivery-item span { flex: 1; font-size: 14px; color: var(--text-secondary); }
.delivery-item small { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.empty-text { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.empty-text a { color: var(--primary); }

/* ── Back Button ─────────────────────────────────────────── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    transition: color .2s;
}
.back-btn:hover { color: var(--primary); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero { padding: 48px 24px 0; }
    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 15px; }
    .steps { flex-direction: column; gap: 20px; }
    .step-arrow { transform: rotate(90deg); margin: 0; padding: 8px 0; }
    .features-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .party-grid { flex-direction: column; }
    .party-arrow { transform: rotate(90deg); }
    .form-row { grid-template-columns: 1fr; }
    .progress-step { min-width: 70px; }
    .progress-label { font-size: 8px; }
    .detail-grid { grid-template-columns: 1fr; }
    .nav-links { gap: 4px; }
    .nav-link { padding: 6px 10px; font-size: 12px; }
    .footer-links { flex-direction: column; gap: 8px; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 24px; }
    .info-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .progress-bar-section { justify-content: flex-start; }
    .result-header { flex-direction: column; gap: 12px; }
    .detail-header { flex-direction: column; gap: 12px; }
}

/* ── Multi-tenant additions ─────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 768px) { .card-grid { grid-template-columns: 1fr; } }
.inline-form .form-row { margin-bottom: 12px; }
.login-hint { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 14px; }
.login-links { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.link-sep { color: var(--text-muted); }
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; max-width: 560px; }
.search-bar .form-input { flex: 1; }
.card-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-bar-sm { margin-bottom: 0; }
.search-bar-sm .form-input { padding: 6px 10px; font-size: 13px; width: 220px; }

/* ── Chat widget (public) ───────────────────────────────────────── */
.chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 1000; font-family: inherit; }
.chat-toggle {
    width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
    background: #1a56db; color: #fff; font-size: 24px; box-shadow: 0 4px 14px rgba(26,86,219,.4);
    display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.chat-toggle:hover { transform: scale(1.06); }
.chat-panel {
    position: absolute; right: 0; bottom: 66px; width: 340px; max-width: calc(100vw - 40px);
    background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(15,23,42,.25);
    border: 1px solid #e2e8f0; overflow: hidden; display: none; flex-direction: column;
}
.chat-widget.open .chat-panel { display: flex; }
.chat-header {
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg,#1a56db,#3b82f6); color: #fff;
    padding: 14px 16px;
}
.chat-sub { font-size: 12px; opacity: .85; }
.chat-close { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.chat-body { padding: 12px; max-height: 380px; display: flex; flex-direction: column; }
.chat-field { margin-bottom: 8px; }
.chat-error { color: #dc2626; font-size: 12px; margin-top: 8px; min-height: 14px; }
.chat-conv { display: flex; flex-direction: column; }
.chat-msgs { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
    padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45;
    word-break: break-word; white-space: pre-wrap;
}
.chat-msg.mine .chat-bubble { background: #1a56db; color: #fff; border-bottom-right-radius: 3px; }
.chat-msg.theirs .chat-bubble { background: #f1f5f9; color: #0f172a; border-bottom-left-radius: 3px; }
.chat-time { font-size: 10px; color: #94a3b8; margin-top: 3px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row .form-input { flex: 1; }

/* ── Tenant chat pages ──────────────────────────────────────────── */
.thread-box {
    max-height: 420px; overflow-y: auto; padding: 14px; display: flex;
    flex-direction: column; gap: 10px; background: #f8fafc; border-radius: 10px;
}
.reply-form { display: flex; gap: 8px; padding: 12px 14px; }
.reply-form .form-input { flex: 1; }
.unread-badge {
    display: inline-block; margin-left: 6px; background: #dc2626; color: #fff;
    border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 700;
}
.cell-muted { color: #64748b; }

