/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
    --primary-orange: #F26522;
    --primary-orange-dark: #d3541a;
    --primary-dark: #222222;
    --primary-gray: #444444;
    --primary-white: #ffffff;
    --primary-link: #F26522;
    --primary-error: #e74c3c;
    --primary-success: #26b050;
    --primary-border: #929292;
    --primary-bg-light: #f8f8f8;
}

/* =============================================
   BASE
   ============================================= */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--primary-white);
    color: var(--primary-dark);
}

h1:focus {
    outline: none;
}

/* =============================================
   LAYOUT
   ============================================= */
.page {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh;
}

    .page .sidebar {
        display: none !important;
    }

.top-row {
    display: none !important;
}

.main-content {
    flex: 1;
    width: 100%;
    min-width: 0;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

    .main-content .content {
        padding-top: 0;
        max-width: 100%;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }

/* =============================================
   TOP NAVBAR
   ============================================= */
.topnav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary-white);
    border-bottom: 3px solid var(--primary-orange);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.topnav-inner {
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 60px;
    position: relative;
}

.topnav-brand {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    margin-right: 2rem;
    flex-shrink: 0;
}

.topnav-links {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0;
    flex-wrap: nowrap;
    overflow: hidden;
}

    .topnav-links .nav-link {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.3rem 0.45rem;
        border-radius: 6px;
        color: var(--primary-dark) !important;
        font-size: 0.8rem;
        font-weight: 500;
        white-space: nowrap;
        text-decoration: none;
        transition: background 0.15s, color 0.15s;
    }

        .topnav-links .nav-link i {
            font-size: 0.9em;
            flex-shrink: 0;
        }

        .topnav-links .nav-link:hover {
            background: rgba(242, 101, 34, 0.1);
            color: var(--primary-orange) !important;
        }

        .topnav-links .nav-link.active {
            background: var(--primary-orange);
            color: var(--primary-white) !important;
        }

.topnav-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 0.25rem;
}

.topnav-links .user-link {
    color: var(--primary-gray) !important;
    font-weight: 600;
}

.topnav-links .logout-link {
    border: 1.5px solid var(--primary-orange);
    color: var(--primary-orange) !important;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
}

    .topnav-links .logout-link:hover {
        background: var(--primary-orange);
        color: var(--primary-white) !important;
    }

/* =============================================
   HAMBURGER (mobile only)
   ============================================= */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
}

    .hamburger span {
        display: block;
        width: 24px;
        height: 3px;
        background: var(--primary-orange);
        border-radius: 2px;
        transition: all 0.25s;
    }

@media (max-width: 900px) {
    .hamburger {
        display: flex;
    }

    .topnav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--primary-white);
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem 1rem;
        border-bottom: 3px solid var(--primary-orange);
        box-shadow: 0 6px 20px rgba(0,0,0,0.08);
        gap: 0.25rem;
    }

        .topnav-links.open {
            display: flex;
        }

        .topnav-links .nav-link {
            width: 100%;
            padding: 0.6rem 0.75rem;
            font-size: 1rem;
        }

    .topnav-right {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
        border-top: 1px solid #eee;
        padding-top: 0.5rem;
        margin-top: 0.25rem;
        gap: 0.25rem;
    }

        .topnav-right .nav-link {
            width: 100%;
        }
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
    color: var(--primary-white);
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--primary-orange-dark);
        border-color: var(--primary-orange-dark);
    }

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--primary-white), 0 0 0 0.25rem var(--primary-orange);
}

.quick-action-btn:hover,
.quick-action-btn:focus {
    background-color: var(--primary-orange) !important;
    border-color: var(--primary-orange) !important;
    color: var(--primary-white) !important;
}

    .quick-action-btn:hover i,
    .quick-action-btn:focus i {
        color: var(--primary-white) !important;
    }

.btn-delete {
    border: 1.5px solid #fc8181;
    color: #c53030;
    background: #fff5f5;
    border-radius: 7px;
    padding: 4px 10px;
    font-size: 0.78rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1.4;
}

    .btn-delete:hover {
        background: #c53030;
        color: var(--primary-white);
        border-color: #c53030;
    }

/* =============================================
   VALIDATION
   ============================================= */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--primary-success);
}

.invalid {
    outline: 1px solid var(--primary-error);
}

.validation-message {
    color: var(--primary-error);
}

/* =============================================
   ADDRESS CARD
   ============================================= */
.address-card-header {
    background: var(--primary-orange);
    color: var(--primary-white);
    font-weight: bold;
    font-size: 1.15rem;
    padding: 0.75rem 1rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.13);
}

/* =============================================
   JOBS TABLE
   ============================================= */
/*.jobs-table-wrapper {*/
/*border-radius: 12px;*/
/*overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1.5px 6px rgba(0,0,0,0.07);*/
/*border: 1.5px solid #e2e8f0;*/
/*background: var(--primary-white);*/
/*}*/

.jobs-scroll {
    overflow-x: auto;
    border-radius: 12px;
}

.jobs-table {
    margin-bottom: 0;
    font-size: 0.82rem;
    font-family: 'Segoe UI', system-ui, sans-serif;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

    .jobs-table thead tr {
        background: linear-gradient(135deg, #1e3a5f 0%, #2563a8 100%);
    }

    .jobs-table thead th {
        color: #e8f0fb;
        font-weight: 600;
        font-size: 0.75rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        padding: 13px 14px;
        border: none;
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 2;
        background: transparent;
    }

        .jobs-table thead th + th {
            border-left: 1px solid rgba(255,255,255,0.12);
        }

    .jobs-table tbody tr {
        transition: background 0.15s, box-shadow 0.15s;
        border-bottom: 1px solid #edf2f7;
    }

        .jobs-table tbody tr:last-child {
            border-bottom: none;
        }

        .jobs-table tbody tr:nth-child(even) {
            background-color: #f7fafd;
        }

        .jobs-table tbody tr:nth-child(odd) {
            background-color: var(--primary-white);
        }

        .jobs-table tbody tr:hover {
            background-color: #dbeafe !important;
            box-shadow: inset 3px 0 0 #2563a8;
            cursor: pointer;
        }

    .jobs-table tbody td {
        padding: 10px 14px;
        vertical-align: middle;
        border: none;
        border-right: 1px solid #edf2f7;
        color: #2d3748;
        white-space: nowrap;
    }

        .jobs-table tbody td:last-child {
            border-right: none;
        }

        .jobs-table tbody td:first-child {
            font-weight: 600;
            color: #1e3a5f;
            font-variant-numeric: tabular-nums;
        }

        .jobs-table tbody td.col-customer {
            font-weight: 500;
            color: #1a202c;
        }

        .jobs-table tbody td.col-address {
            color: #4a5568;
            font-size: 0.78rem;
        }

        .jobs-table tbody td.col-supplier {
            color: #553c9a;
            font-weight: 500;
        }

        .jobs-table tbody td.col-driver {
            font-weight: 500;
        }

        .jobs-table tbody td.col-rate {
            font-variant-numeric: tabular-nums;
            font-weight: 600;
            color: #276749;
            background: #f0faf4;
            text-align: right;
        }

.job-ref {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.vehicle-badge {
    display: inline-block;
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fde68a;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
}

.jobs-table .state-row td {
    text-align: center;
    color: #718096;
    padding: 40px 0;
    font-size: 0.92rem;
    background: var(--primary-white) !important;
    box-shadow: none !important;
    border: none;
}

tr.job-status-orange, tr.job-status-orange td {
    background-color: #ffe5b4 !important;
}

tr.job-status-green, tr.job-status-green td {
    background-color: #d4edda !important;
}

tr.job-status-yellow, tr.job-status-yellow td {
    background-color: #fff9c4 !important;
}

/* =============================================
   RESPONSIVE TABLE (small screens)
   ============================================= */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 576px) {
    .table-responsive table thead {
        display: none;
    }

    .table-responsive table tr {
        display: block;
        margin-bottom: 1rem;
        border-bottom: 2px solid var(--primary-border);
    }

    .table-responsive table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
        border: none;
        border-bottom: 1px solid var(--primary-border);
        font-size: 1rem;
    }

        .table-responsive table td::before {
            content: attr(data-label);
            font-weight: bold;
            color: var(--primary-dark);
            margin-right: 1rem;
            min-width: 90px;
        }
}

/* =============================================
   BLAZOR ERROR BOUNDARY
   ============================================= */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg...)==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* =============================================
   JOB FORM
   ============================================= */

.job-form-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

/* Header */
.job-form-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid #f0f0f0;
}

.job-form-header-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-orange);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.job-form-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
    line-height: 1.2;
}

.job-form-subtitle {
    font-size: 0.82rem;
    color: var(--primary-gray);
    margin: 0.15rem 0 0;
}

/* Sections */
.job-section {
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.job-section-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fafafa;
    border-bottom: 1.5px solid #e8e8e8;
    padding: 0.6rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary-gray);
}

.job-section-num {
    width: 20px;
    height: 20px;
    background: var(--primary-orange);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.job-section-body {
    padding: 1rem 1rem 1.1rem;
}

/* Field labels */
.jf-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.3rem;
}

.jf-required {
    color: var(--primary-error);
    margin-left: 2px;
}

/* Inputs — subtle focus ring in orange */
.jf-input:focus {
    border-color: var(--primary-orange) !important;
    box-shadow: 0 0 0 2px rgba(242,101,34,0.15) !important;
    outline: none;
}

.jf-validation {
    display: block;
    font-size: 0.73rem;
    color: var(--primary-error);
    margin-top: 0.2rem;
}

/* Checkboxes */
.jf-check-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.jf-check-group--card {
    background: #fafafa;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

    .jf-check-group--card:has(.jf-checkbox:checked) {
        border-color: var(--primary-orange);
        background: #fff5ef;
    }

.jf-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-orange);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.jf-check-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary-dark);
    cursor: pointer;
    margin: 0;
    user-select: none;
}

/* Inline sub-forms (add customer/supplier/address) */
.jf-inline-form {
    background: #fdf8f5;
    border: 1.5px solid rgba(242,101,34,0.25);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}

.jf-inline-form-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-orange);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.jf-inline-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.jf-btn-add {
    background: var(--primary-orange);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.8rem;
}

    .jf-btn-add:hover {
        background: var(--primary-orange-dark);
        color: #fff;
    }

.jf-inline-error {
    background: #fff0f0;
    border: 1px solid #f5c6cb;
    color: var(--primary-error);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    margin-top: 0.5rem;
}

/* Error alert */
.job-alert-error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fff0f0;
    border: 1.5px solid #f5c6cb;
    color: var(--primary-error);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Action buttons */
.job-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1.5px solid #f0f0f0;
}

.jf-btn-save {
    background: var(--primary-orange);
    color: #fff;
    border: none;
    padding: 0.5rem 1.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 7px;
    transition: background 0.15s;
    min-width: 150px;
}

    .jf-btn-save:hover {
        background: var(--primary-orange-dark);
        color: #fff;
    }

.jf-btn-cancel {
    background: #fff;
    color: var(--primary-gray);
    border: 1.5px solid #d0d0d0;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 7px;
    transition: border-color 0.15s, color 0.15s;
}

    .jf-btn-cancel:hover {
        border-color: var(--primary-dark);
        color: var(--primary-dark);
    }


/* =============================================
   PROFESSIONAL FORM UPGRADE
   ============================================= */

/* Page width refinement */
.job-form-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

/* Header polish */
.job-form-header {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid #eee;
    box-shadow: 0 4px 18px rgba(0,0,0,0.04);
}

/* Sections → modern card style */
.job-section {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

    .job-section:hover {
        box-shadow: 0 10px 28px rgba(0,0,0,0.07);
    }

/* Section header */
.job-section-label {
    background: linear-gradient(to right, #fafafa, #ffffff);
    padding: 0.7rem 1rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

/* Section body spacing */
.job-section-body {
    padding: 1.2rem 1.2rem 1.3rem;
}

/* Inputs */
.jf-input {
    border-radius: 6px;
    border: 1px solid #dcdcdc;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

    .jf-input:hover {
        border-color: #bdbdbd;
    }

    /* Focus = premium feel */
    .jf-input:focus {
        border-color: var(--primary-orange) !important;
        box-shadow: 0 0 0 3px rgba(242,101,34,0.12) !important;
    }

/* Labels */
.jf-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
}

/* Checkbox cards upgrade */
.jf-check-group--card {
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    transition: all 0.15s ease;
}

    .jf-check-group--card:hover {
        border-color: var(--primary-orange);
    }

/* Inline forms (Add Customer/Supplier) */
.jf-inline-form {
    background: #fffaf7;
    border: 1px solid rgba(242,101,34,0.3);
    border-left: 4px solid var(--primary-orange);
    border-radius: 10px;
}

/* Buttons */
.jf-btn-save {
    box-shadow: 0 4px 14px rgba(242,101,34,0.3);
}

    .jf-btn-save:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(242,101,34,0.35);
    }

/* Sticky action bar (BIG UX WIN) */
.job-form-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    z-index: 10;
}

/* Error alert cleaner */
.job-alert-error {
    border-left: 4px solid var(--primary-error);
}

/* =============================================
   RESPONSIVE IMPROVEMENTS
   ============================================= */

@media (max-width: 768px) {

    .job-form-page {
        padding: 1rem 0.6rem 4rem;
    }

    .job-section-body {
        padding: 1rem;
    }

    /* Stack everything nicely */
    .row.g-3 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Inline forms full width */
    .jf-inline-form .row > div {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Buttons full width */
    .job-form-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .jf-btn-save,
    .jf-btn-cancel {
        width: 100%;
    }

    /* Header stack */
    .job-form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* =============================================
   MICRO-UX IMPROVEMENTS
   ============================================= */

/* Smooth transitions everywhere */
.job-section,
.jf-btn-save,
.jf-input,
.jf-check-group--card {
    transition: all 0.2s ease;
}

/* Better select dropdown look */
select.jf-input {
    cursor: pointer;
}

/* Required star emphasis */
.jf-required {
    font-size: 0.8rem;
}

/* Improve time picker alignment */
.input-group-sm select {
    font-weight: 600;
}

/* HERO */
.dashboard-hero {
    background: #F26522;
    color: white;
}

/* KPI CARDS */
/* =============================================
   KPI CARDS (FIXED - PROFESSIONAL LOOK)
   ============================================= */

.kpi-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

    /* LEFT ACCENT BAR (KEY VISUAL FIX) */
    .kpi-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 5px;
        background: var(--primary-orange);
        border-top-left-radius: 14px;
        border-bottom-left-radius: 14px;
    }

    /* HOVER EFFECT */
    .kpi-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 28px rgba(0,0,0,0.10);
    }

    /* NUMBER */
    .kpi-card h3 {
        font-size: 1.6rem;
        margin: 0;
    }

    /* LABEL */
    .kpi-card p {
        font-size: 0.8rem;
        margin-bottom: 4px;
        color: var(--primary-gray);
    }

/* ICON */
.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: rgba(242, 101, 34, 0.1);
    color: var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
/* QUICK ACTION CARDS */
.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-radius: 14px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    color: #212529;
    font-weight: 500;
}

    .quick-card:hover {
        background: #F26522;
        color: white;
        transform: translateY(-3px);
    }

.quick-icon {
    font-size: 22px;
    margin-bottom: 8px;
}

.custom-table thead {
    background: #f8f9fa;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.custom-table tbody tr {
    transition: all 0.15s ease;
}

.table-row-hover:hover {
    background-color: #f9fbff;
}

.custom-table td,
.custom-table th {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

/* Collapsible columns */
/*.collapsible-cell {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: max-width 0.3s ease, white-space 0.3s ease;
}

    .collapsible-cell:hover {
        max-width: 500px;*/ /* Expand width on hover */
/*white-space: normal;*/ /* Show full text */
/*background-color: #f8f9fa;*/ /* Optional highlight */
/*z-index: 1;
        position: relative;
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
        padding: 2px 5px;
    }*/



/* =====================================================================
   PostcodeLookup.razor.css
   Scoped styles for the postcode lookup widget.
   Matches the Speed Drop Freight jf-* design language.
   ===================================================================== */
/* ── Wrapper ── */
.pc-lookup-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* ── Input row ── */
.pc-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pc-input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
}

    .pc-input-group:focus-within {
        border-color: #F26522;
        box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.12);
    }

    .pc-input-group .is-invalid ~ .pc-lookup-btn {
        border-left-color: #dc3545;
    }

.pc-input-icon {
    display: flex;
    align-items: center;
    padding: 0 0.6rem;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.8rem;
}

.pc-input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.35rem 0.6rem;
    min-width: 0;
}

    .pc-input:focus {
        outline: none;
        box-shadow: none !important;
    }

    .pc-input.is-invalid {
        background-color: #fff8f8;
    }

.pc-lookup-btn {
    background: #F26522;
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, opacity 0.15s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

    .pc-lookup-btn:hover:not(:disabled) {
        background: #d9541a;
    }

    .pc-lookup-btn:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

/* ── Error message ── */
.pc-error-msg {
    font-size: 0.78rem;
    color: #dc3545;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.1rem;
}

/* ── Results panel ── */
.pc-results-panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.65rem 0.75rem 0.5rem;
    animation: pc-slide-in 0.18s ease;
}

@keyframes pc-slide-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pc-results-header {
    font-size: 0.78rem;
    color: #6c757d;
    margin-bottom: 0.45rem;
}

    .pc-results-header strong {
        color: #212529;
    }

.pc-results-select {
    font-size: 0.82rem;
    border-color: #dee2e6;
    color: #212529;
    cursor: pointer;
    transition: border-color 0.15s;
}

    .pc-results-select:focus {
        border-color: #F26522;
        box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.12);
    }

.pc-clear-btn {
    font-size: 0.75rem;
    color: #6c757d;
    text-decoration: none;
    padding: 0.2rem 0;
    margin-top: 0.2rem;
    display: inline-flex;
    align-items: center;
}

    .pc-clear-btn:hover {
        color: #dc3545;
    }

/* ── Manual entry toggle ── */
.pc-manual-toggle {
    display: flex;
    align-items: center;
}

.pc-manual-btn {
    font-size: 0.78rem;
    color: #6c757d;
    text-decoration: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

    .pc-manual-btn:hover {
        color: #F26522;
    }


/* =====================================================================
   PostcodeLookup.razor.css  — v2 typeahead/debounce styles
   ===================================================================== */

.pc-lookup-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    position: relative;
}

/* ── Input group ── */
.pc-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pc-input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .pc-input-group:focus-within {
        border-color: #F26522;
        box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.12);
    }

.pc-input-group--error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.10) !important;
}

.pc-input-group--loading {
    border-color: #F26522;
}

/* ── Icon slot ── */
.pc-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.82rem;
}

.pc-spinner {
    color: #F26522;
}

.pc-icon-success {
    color: #198754;
}

.pc-icon-error {
    color: #dc3545;
}

/* ── Text input ── */
.pc-input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.38rem 0.6rem;
    min-width: 0;
    background: transparent;
}

    .pc-input:focus {
        outline: none;
        box-shadow: none !important;
    }

/* ── Clear × button ── */
.pc-clear-input-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    background: transparent;
    border: none;
    color: #adb5bd;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

    .pc-clear-input-btn:hover {
        color: #dc3545;
    }

/* ── Hint text ── */
.pc-hint {
    font-size: 0.75rem;
    color: #6c757d;
    padding: 0.1rem 0.1rem;
    display: flex;
    align-items: center;
}

/* ── Error message ── */
.pc-error-msg {
    font-size: 0.78rem;
    color: #dc3545;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.1rem;
}

/* ── Results panel ── */
.pc-results-panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    animation: pc-slide-in 0.15s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
}

@keyframes pc-slide-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pc-results-header {
    font-size: 0.75rem;
    color: #6c757d;
    padding: 0.45rem 0.75rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

    .pc-results-header strong {
        color: #212529;
    }

/* ── Individual result rows ── */
.pc-results-list {
    max-height: 220px;
    overflow-y: auto;
}

.pc-result-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.1s ease;
    font-size: 0.82rem;
    color: #212529;
}

    .pc-result-item:last-child {
        border-bottom: none;
    }

    .pc-result-item--hovered,
    .pc-result-item:hover {
        background: #fff5f0;
    }

.pc-result-icon {
    color: #F26522;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.pc-result-text {
    flex: 1;
    min-width: 0;
}

.pc-result-line1 {
    font-weight: 500;
}

.pc-result-line2 {
    color: #6c757d;
}

.pc-result-postcode {
    font-size: 0.75rem;
    color: #F26522;
    font-weight: 600;
}

/* ── Manual entry link ── */
.pc-manual-toggle {
    display: flex;
    align-items: center;
}

.pc-manual-btn {
    font-size: 0.78rem;
    color: #6c757d;
    text-decoration: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

    .pc-manual-btn:hover {
        color: #F26522;
    }

.pc-fields-placeholder {
    font-size: 0.82rem;
    color: var(--bs-secondary-color, #6c757d);
    padding: 0.65rem 0.85rem;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
    background: #fafafa;
    display: flex;
    align-items: center;
}

.hover-bg:hover {
    background-color: #f5f5f5;
}

.cursor-pointer {
    cursor: pointer;
}

.customer-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    background: white;
    z-index: 99999;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.jf-stop-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.jf-stop-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.jf-stop-card-body {
    padding: 14px;
}

.dash-topbar {
    background: var(--bs-body-bg, #fff);
    border-bottom: 0.5px solid #e0e0e0;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-brand-icon {
    width: 28px;
    height: 28px;
    background: #F26522;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .dash-brand-icon svg {
        width: 16px;
        height: 16px;
        fill: white;
    }

.dash-brand-name {
    font-size: 22px;
    font-weight: 600;
    color: inherit;
    letter-spacing: -0.2px;
}

.dash-brand-sub {
    font-weight: 400;
    opacity: 0.5;
    margin-left: 1px;
}

.dash-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-date {
    font-size: 19px;
    opacity: 0.55;
}

.btn-new-job {
    background: #F26522;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 14px;
    height: 32px;
    font-size: 19px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .btn-new-job:hover {
        background: #d45518;
        color: #fff;
    }

.dash-layout {
    display: flex;
    min-height: calc(100vh - 52px);
    font-size: 17px;
}

.dash-sidebar {
    width: 52px;
    flex-shrink: 0;
    border-right: 0.5px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 0;
    gap: 4px;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    background: var(--bs-body-bg, #fff);
}

.dash-nav-item {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #888;
    position: relative;
    border: none;
    background: transparent;
    text-decoration: none;
    transition: background 0.1s;
}

    .dash-nav-item.active {
        background: #FEF0E8;
        color: #F26522;
    }

    .dash-nav-item:hover:not(.active) {
        background: #f5f5f5;
        color: #333;
    }

    .dash-nav-item svg {
        width: 18px;
        height: 18px;
    }

.dash-nav-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #F26522;
    position: absolute;
    right: 5px;
    top: 5px;
}

.dash-main {
    flex: 1;
    min-width: 0;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 17px;
}

/* KPI Cards */
.dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dash-kpi-card {
    background: var(--bs-body-bg, #fff);
    border: 0.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px 16px;
}

.kpi-label {
    font-size: 15px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 29px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-sub {
    font-size: 15px;
    color: #888;
}

.kpi-pill {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
}

.kpi-pill-green {
    background: #E1F5EE;
    color: #0F6E56;
}

.kpi-pill-amber {
    background: #FEF0E8;
    color: #C44E12;
}

.kpi-pill-blue {
    background: #E6F1FB;
    color: #185FA5;
}

/* Filter Bar */
.dash-filters {
    background: var(--bs-body-bg, #fff);
    border: 0.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-filter-label {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

.dash-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-filter-input,
.dash-filter-select {
    height: 30px;
    border: 0.5px solid #ccc;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: inherit;
}

.dash-filter-input {
    width: 140px;
}

.dash-filter-select {
    width: 130px;
}

    .dash-filter-input:focus,
    .dash-filter-select:focus {
        border-color: #F26522;
    }

.dash-filter-divider {
    width: 0.5px;
    height: 18px;
    background: #e0e0e0;
    margin: 0 2px;
}

.btn-clear-filters {
    margin-left: auto;
    background: none;
    border: 0.5px solid #ccc;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 15px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .btn-clear-filters:hover {
        border-color: #999;
        color: #333;
    }

/* Table */
.dash-table-wrap {
    background: var(--bs-body-bg, #fff);
    border: 0.5px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
}

.dash-table-header {
    padding: 12px 16px 10px;
    border-bottom: 0.5px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-table-title {
    font-size: 17px;
    font-weight: 600;
}

.dash-record-count {
    font-size: 16px;
    color: #888;
}

.dash-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 200px); /* tweak 200px to match your navbar/filter bar height */
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

    .dash-table thead th {
        text-align: left;
        padding: 9px 12px;
        font-size: 15px;
        font-weight: 500;
        color: white;
        letter-spacing: 0.3px;
        border-bottom: 0.5px solid #e0e0e0;
        white-space: nowrap;
        background: #F26522;
        position: sticky;
        top: 0;
    }

    .dash-table tbody tr {
        border-bottom: 0.5px solid #f0f0f0;
        cursor: pointer;
        transition: background 0.1s;
        border-left: 3px solid transparent;
    }

        .dash-table tbody tr:last-child {
            border-bottom: none;
        }

        .dash-table tbody tr:hover {
            background: #f9f9f9;
        }

    .dash-table tbody td {
        padding: 10px 12px;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }

/* Row accent colors by status */
.row-accent-orange {
    border-left-color: #F26522 !important;
}

.row-accent-blue {
    border-left-color: #378ADD !important;
}

.row-accent-green {
    border-left-color: #1D9E75 !important;
}

.row-accent-gray {
    border-left-color: #B4B2A9 !important;
}

/* Status badges */
.status-badge {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.status-booked {
    background: #FEF0E8;
    color: #C44E12;
}

.status-assigned {
    background: #E6F1FB;
    color: #185FA5;
}

.status-delivered {
    background: #E1F5EE;
    color: #0F6E56;
}

.status-pod {
    background: #EAF3DE;
    color: #3B6D11;
}

.status-invoiced {
    background: #F1EFE8;
    color: #5F5E5A;
}

.job-ref-badge {
    font-family: monospace;
    font-size: 15px;
    font-weight: 600;
}

.vehicle-badge {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f0f0f0;
    border: 0.5px solid #ddd;
    color: #666;
    font-family: monospace;
}

.driver-cell {
    display: flex;
    align-items: center;
    gap: 7px;
}

.driver-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    background: #FEF0E8;
    color: #F26522;
}

.rate-cell {
    font-family: monospace;
    font-size: 16px;
}

.btn-row-delete {
    background: none;
    border: 0.5px solid #ddd;
    border-radius: 5px;
    padding: 4px 9px;
    font-size: 15px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

    .btn-row-delete:hover {
        background: #FCEBEB;
        border-color: #F09595;
        color: #A32D2D;
    }

.state-row td {
    text-align: center;
    padding: 36px 12px !important;
    color: #888;
    font-size: 17px;
}

@@media (max-width: 900px) {
    .dash-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-sidebar {
        display: none;
    }

    .dash-date {
        display: none;
    }
}

/* ── Job Tabs ── */
.job-tabs-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bs-body-bg, #fff);
    border: 0.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 5px;
    width: fit-content;
}

.job-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1;
}

    .job-tab:hover:not(.job-tab--active) {
        background: #f5f5f5;
        color: #333;
    }

.job-tab--active {
    background: #FEF0E8;
    color: #F26522;
    box-shadow: 0 0 0 0.5px #F2652240;
}

.job-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.job-tab-count--orange {
    background: #F26522;
    color: #fff;
}

.job-tab-count--gray {
    background: #e8e8e8;
    color: #666;
}

/* Active tab — count badge inverts to white bg + orange text */
.job-tab--active .job-tab-count--gray {
    background: #fff;
    color: #F26522;
}
/* Stops pill button in table */
.stops-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: #FEF0E8;
    color: #F26522;
    border: 0.5px solid #F2652240;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s;
}

    .stops-pill:hover {
        background: #FDDCC8;
    }

/* Overlay */
.stops-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

/* Modal */
.stops-modal {
    background: var(--bs-body-bg, #fff);
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.14);
    overflow: hidden;
}

.stops-modal-header {
    padding: 14px 16px;
    border-bottom: 0.5px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.stops-modal-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.stops-modal-sub {
    font-size: 13px;
    color: #888;
}

.stops-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 0.5px solid #e0e0e0;
    background: transparent;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .stops-modal-close:hover {
        background: #f5f5f5;
        color: #333;
    }

/* Body / scroll */
.stops-modal-body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Timeline */
.stop-timeline-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.stop-timeline-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding-top: 2px;
}

.stop-timeline-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.dot-collection {
    background: #1D9E75;
}

.dot-delivery {
    background: #F26522;
}

.stop-timeline-line {
    width: 1.5px;
    flex: 1;
    min-height: 16px;
    background: #e0e0e0;
    margin: 4px 0;
}

/* Stop card */
.stop-info-card {
    flex: 1;
    border: 0.5px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-collection {
    border-left: 3px solid #1D9E75;
}

.card-delivery {
    border-left: 3px solid #F26522;
}

.stop-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.stop-type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-collection {
    background: #E1F5EE;
    color: #0F6E56;
}

.badge-delivery {
    background: #FEF0E8;
    color: #C44E12;
}

.stop-time {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.stop-company {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
}

.stop-address-block {
    font-size: 13px;
    line-height: 1.5;
}

.stop-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.stop-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #555;
}

.stop-notes-block {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: #555;
    background: #f7f7f7;
    border: 0.5px solid #e8e8e8;
    border-radius: 5px;
    padding: 6px 8px;
    line-height: 1.4;
    margin-top: 2px;
}
.row-locked {
    opacity: 0.55;
    pointer-events: none; 
    cursor: default;
}

    .row-locked .btn-row-delete,
    .row-locked .stops-pill {
        pointer-events: none;
        opacity: 0.4;
    }
/* ── Session Expired Overlay ── */
.session-expired-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-expired-dialog {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: session-pop 0.25s ease-out;
}

@keyframes session-pop {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.session-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff3cd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

    .session-icon i {
        font-size: 1.8rem;
        color: #f59e0b;
    }

.session-expired-dialog h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.session-time {
    font-size: 0.78rem;
    color: #aaa;
    margin-bottom: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.session-message {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.session-btn {
    width: 100%;
    padding: 0.6rem;
    font-weight: 600;
    border-radius: 8px;
    font-size: 0.95rem;
}