body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.card {
    border-radius: 0.6rem;
}

.btn {
    border-radius: 0.4rem;
}

.table th, .table td {
    vertical-align: middle;
}

.receipt-timeline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.receipt-timeline .timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.receipt-timeline .timeline-step::after {
    content: '';
    position: absolute;
    top: 8px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: 1;
}

.receipt-timeline .timeline-step:last-child::after {
    display: none;
}

.timeline-node {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #dee2e6;
    margin: 0 auto 0.25rem;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}

.timeline-step.completed .timeline-node {
    background: #198754;
}

.timeline-step.completed .timeline-node::after {
    content: '✓';
}

.timeline-step.reached .timeline-node {
    background: #198754;
    color: #fff;
}

.timeline-step.reached .timeline-node::after {
    content: '✓';
}

.timeline-step.current.reached .timeline-node {
    background: #198754;
    border: 2px solid #198754;
    color: #fff;
}

.timeline-step.rejected .timeline-node {
    background: #dc3545;
    color: #fff;
    border: 0;
}

.timeline-step.rejected .timeline-node::after {
    content: '×';
}

.timeline-step.reached::after {
    background: #198754;
}

.timeline-step.completed::after {
    background: #198754;
}

.timeline-label {
    font-size: 0.75rem;
    color: #6c757d;
}

.product-row .btn {
    min-width: 44px;
}

.product-row .add-product {
    border-color: #0d6efd;
    color: #0d6efd;
}

.product-row .remove-product {
    border-color: #dc3545;
    color: #dc3545;
}

.nav-btn {
    border-radius: 999px;
    border-width: 1px;
    padding: 0.4rem 0.95rem;
    font-weight: 500;
    border-color: #6c757d;
    color: #343a40;
    background-color: #fff;
}

.nav-btn .badge {
    margin-left: 0.25rem;
}

.nav-btn:hover,
.nav-btn:focus {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.15);
}

.navbar .navbar-nav {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.navbar .nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.navbar .dropdown-menu {
    min-width: 16rem;
}

.nav-status {
    border: 1px solid #ced4da;
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    color: #6c757d;
}

.onforward-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.onforward-pill .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
}

.onforward-pill.pending {
    background: #dc3545;
    color: #fff;
}

.onforward-pill.onforwarded {
    background: #198754;
    color: #fff;
}

/* Responsive refinements */
.container,
.container-fluid {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

@media (max-width: 1199.98px) {
    .navbar .navbar-nav {
        gap: 0.35rem;
    }

    .navbar .nav-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .navbar .nav-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .navbar .nav-status {
        width: 100%;
        justify-content: flex-start;
    }

    .navbar .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0.25rem;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.95rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table {
        font-size: 0.9rem;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 575.98px) {
    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar-brand {
        font-size: 1rem;
        white-space: normal;
        line-height: 1.25;
    }
}

.kb-launcher {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1050;
    border-radius: 999px;
    padding: 0.75rem 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 0.75rem 1.5rem rgba(13, 110, 253, 0.22);
}

.kb-launcher-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    position: relative;
    display: inline-block;
}

.kb-launcher-pulse::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    animation: kbPulse 1.8s infinite;
}

@keyframes kbPulse {
    0% { transform: scale(0.9); opacity: 0.9; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(0.9); opacity: 0; }
}

.kb-drawer {
    max-width: 420px;
    border-left: 1px solid #e5e7eb;
}

.kb-meta .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.kb-pillars {
    display: grid;
    gap: 0.75rem;
}

.kb-pillars__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    background: #f8f9fa;
}

.kb-pillars__icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.kb-shortcuts .list-group-item {
    border: 0;
    border-bottom: 1px solid #f1f3f5;
    padding-left: 0;
    padding-right: 0;
}

.kb-shortcuts .list-group-item:last-child {
    border-bottom: 0;
}

.kb-page .kb-hero {
    background: linear-gradient(135deg, #f3f8ff 0%, #f7fbff 45%, #ffffff 100%);
}

.kb-hero__cta {
    min-width: 220px;
    text-align: right;
}

.kb-list .kb-bullet,
.kb-checklist .kb-bullet {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #0d6efd;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.kb-callout {
    border: 1px dashed #ced4da;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
    background: #f8f9fa;
}

.kb-dot {
    color: #0d6efd;
    font-size: 1.2rem;
    line-height: 1;
}

.kb-support .fw-semibold {
    font-size: 0.95rem;
}

@media (max-width: 767.98px) {
    .kb-launcher {
        right: 1rem;
        bottom: 1rem;
    }

    .kb-hero__cta {
        width: 100%;
        text-align: left;
    }
}
