body {
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
}

.sidebar .nav-link {
    color: #3e4a5b;
    font-weight: 500;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background-color: #e9f4ff;
    color: #0d6efd;
}

.content {
    flex: 1;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
}

.db-switcher-wrap {
    min-width: 230px;
}

.db-switcher-select {
    min-width: 130px;
}

.db-badge {
    min-width: 88px;
    text-align: center;
}

.card-stat {
    border: 0;
    box-shadow: 0 0.5rem 1rem rgba(25, 44, 74, 0.08);
}

.login-card {
    max-width: 430px;
    margin: 0 auto;
}

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

.note-list {
    max-height: 350px;
    overflow-y: auto;
}

.customer-info-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-info-section {
    border: 1px solid #8fd0f3;
    border-radius: 0;
    padding: 0.9rem 0.95rem;
    background-color: #ffffff;
}

.customer-info-section-full {
    grid-column: 1 / -1;
}

.customer-info-title {
    display: inline-block;
    margin: -1.45rem 0 0.75rem;
    padding: 0 0.35rem;
    background-color: #fff;
    font-size: 0.85rem;
    font-weight: 400;
    color: #244f6d;
}

.customer-field-list {
    display: grid;
    gap: 0.55rem;
}

.customer-field {
    display: grid;
    gap: 0.2rem;
}

.customer-field-label {
    display: block;
    font-size: 0.68rem;
    color: #4f677a;
    margin: 0;
}

.customer-field-box {
    min-height: 2rem;
    border: 1px solid #d7dde5;
    background-color: #fbfbfc;
    padding: 0.45rem 0.55rem;
    color: #21313f;
    font-size: 0.9rem;
    line-height: 1.35;
    display: flex;
    align-items: center;
}

.customer-field-box-notes {
    min-height: 4.5rem;
    align-items: flex-start;
    white-space: pre-line;
}

.customer-info-notes {
    min-height: 3rem;
    white-space: pre-line;
    color: #1f2d3d;
}

.route-run-shell {
    max-width: 480px;
    margin: 0 auto;
}

.route-run-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5c7c95;
    font-weight: 700;
}

.route-run-progress {
    height: 0.6rem;
    background-color: #dfe8f1;
}

.route-stop-card {
    border-radius: 1rem;
    background-color: #eef9f1;
    border: 1px solid #bfe3c8;
}

.route-stop-detail-list {
    display: grid;
    gap: 0.85rem;
}

.route-stop-detail {
    border: 1px solid #d7e3ee;
    border-radius: 0.9rem;
    padding: 0.85rem 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.route-stop-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #59738a;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.route-stop-value {
    color: #1f2d3d;
    font-size: 1rem;
    line-height: 1.45;
}

.route-complete-button {
    min-height: 3.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 0.9rem;
}

.route-stop-queue {
    display: grid;
    gap: 0.55rem;
}

.route-stop-queue-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #dde5ed;
    border-radius: 0.8rem;
    font-size: 0.92rem;
    background-color: #fff;
}

.route-stop-queue-item.is-current {
    border-color: #0d6efd;
    background-color: #eef5ff;
}

.route-stop-queue-item.is-complete {
    color: #557163;
    background-color: #eef9f1;
    border-color: #bfe3c8;
}

.route-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 1rem;
    align-items: start;
}

.route-map-stage {
    position: relative;
}

.route-map-canvas {
    min-height: 520px;
    border: 1px solid #d7e3ee;
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(180deg, #f9fbfd 0%, #eef5ff 100%);
}

.master-map-canvas {
    min-height: 68vh;
    border: 1px solid #d7e3ee;
    background: linear-gradient(180deg, #f9fbfd 0%, #eef5ff 100%);
}

.route-map-navigate {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    min-height: 3.2rem;
    border-radius: 0.85rem;
    font-weight: 700;
}

.route-map-side {
    display: grid;
    gap: 1rem;
}

.route-summary-card {
    border: 1px solid #d7e3ee;
    border-radius: 1rem;
    background-color: #ffffff;
    padding: 1rem 1.1rem;
    box-shadow: 0 0.5rem 1rem rgba(25, 44, 74, 0.05);
}

.route-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #eef1f4;
}

.route-summary-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.route-summary-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #59738a;
    font-weight: 700;
}

.route-summary-value {
    font-size: 1rem;
    color: #1f2d3d;
    font-weight: 700;
    text-align: right;
}

.dispatch-list {
    max-height: 720px;
    overflow-y: auto;
}

.dispatch-route-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dispatch-route-card {
    min-height: 280px;
}

.dispatch-stop-list {
    display: grid;
    gap: 0.5rem;
    max-height: 360px;
    overflow-y: auto;
}

.dispatch-stop-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid #dde5ed;
    border-radius: 0.5rem;
    padding: 0.55rem 0.65rem;
    background-color: #fff;
}

.route-stop-list {
    display: grid;
    gap: 0.7rem;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.route-stop-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    width: 100%;
    text-align: left;
    border: 1px solid #d7e3ee;
    border-radius: 0.95rem;
    background-color: #ffffff;
    color: #1f2d3d;
    padding: 0.9rem 1rem;
    box-shadow: 0 0.45rem 0.9rem rgba(25, 44, 74, 0.04);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.route-stop-list-item:hover,
.route-stop-list-item:focus {
    border-color: #8fd0f3;
    box-shadow: 0 0.6rem 1.2rem rgba(13, 110, 253, 0.08);
    transform: translateY(-1px);
}

.route-stop-list-item.is-active {
    border-color: #0d6efd;
    background-color: #eef5ff;
    box-shadow: 0 0.75rem 1.3rem rgba(13, 110, 253, 0.12);
}

.route-stop-list-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.3rem;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    background-color: #0d6efd;
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 700;
}

.route-stop-list-copy {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.route-stop-list-name {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    color: #1f2d3d;
}

.route-stop-list-meta {
    display: block;
    font-size: 0.86rem;
    color: #59738a;
    line-height: 1.45;
}

.onboarding-page {
    max-width: 920px;
}

.onboarding-header {
    padding: 1rem 0 0.25rem;
}

.onboarding-header h1 {
    color: #172433;
}

.onboarding-form {
    border: 1px solid #dbe4ec;
    background-color: #ffffff;
    padding: 1.25rem;
    box-shadow: 0 0.6rem 1.4rem rgba(25, 44, 74, 0.06);
}

.onboarding-submit {
    background-color: var(--onboarding-brand, #0d6efd);
    border-color: var(--onboarding-brand, #0d6efd);
    min-height: 3.2rem;
    width: 100%;
}

.dashboard-chart,
.report-chart {
    display: block;
    min-height: 260px;
    height: 260px;
    width: 100%;
}

@media (max-width: 991.98px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .customer-info-grid {
        grid-template-columns: 1fr;
    }

    .customer-info-section-full {
        grid-column: auto;
    }

    .route-map-layout {
        grid-template-columns: 1fr;
    }

    .route-map-canvas {
        min-height: 58vh;
    }

    .route-stop-list {
        max-height: none;
    }

    .dispatch-route-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .customer-info-title {
        margin-top: -1.35rem;
    }

    .route-run-shell {
        max-width: 100%;
    }

    .route-stop-detail {
        padding: 0.8rem 0.85rem;
    }

    .route-stop-queue-item {
        font-size: 0.86rem;
    }

    .route-map-canvas {
        min-height: 54vh;
    }

    .route-map-navigate {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .route-stop-list-item {
        padding: 0.95rem;
    }

    .route-stop-list-order {
        flex-basis: 2.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}
