/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    min-height: 100vh;
    max-height: 100vh;
}

/* Container */
.container {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    max-height: 100vh;
}

/* Header */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    box-sizing: border-box; /* Prevents padding from pushing width over 100% */
}


.logo {
    height: 50px;
}

/* Content */
.content {
    display: flex;
    flex: 1;
    width: 100%;
    overflow-x: hidden;
    max-height: 100vh;
}

/* Sidebar */
.side-nav {
    padding: 2rem 1rem;
    height: calc(100vh - 80px);
    width: 220px; /* <-- width, not min-width */
    flex-shrink: 0; /* prevents collapsing */
}

.side-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.side-nav a {
    text-decoration: none;
    color: #ccc;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.side-nav a:hover {
    color: #ffffff;
    transform: translateX(5px);
}

.hamburger {
    display: none; /* hidden by default, shown with media query */
    font-size: 2rem; /* make the hamburger icon bigger */
    background: none; /* no button background */
    border: none; /* no border */
    color: #333; /* color of the hamburger icon */
    cursor: pointer; /* pointer cursor on hover */
    position: absolute; /* position it */
    top: 1rem; /* some space from the top */
    right: 1rem; /* some space from the right */
    z-index: 1000; /* make sure it's on top of everything */
}

/* Main */
main {
    flex-grow: 1;
    padding: 2rem;
    width: 100%;
    overflow-x: auto;
    overflow-y: scroll; 
}

/* Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.card input {
    display: block;
    width: 100%; /* Makes input take up the full label width */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

.card input:disabled {
    background-color: #e9eff6;
    color: black;
}

.delivery-cards {
    display: flex;
    justify-content: space-evenly;
    gap: 20px;
    padding-bottom: 20px;
}

.delivery-cards .card{
    width: 100%;
}

.card label {
    display: block;
    font-weight: bold;
    margin: 10px 0 10px;
    color: #555;
    width: 100%; /* Ensures input fields take up the same width */
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.big-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 1rem;
}

/* Progress Tracker */
.progress-card {
    margin-top: 2rem;
}

.progress-tracker {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.big-star {
    font-size: 3rem;
}

.plain-link {
    text-decoration: none;
}

.progress-content {
    flex: 1;
}

.progress-percentage {
    font-weight: bold;
    color: #28a745;
}

.progress-bar {
    width: 100%;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    height: 12px;
    margin-top: 0.5rem;
}

.progress {
    height: 100%;
    background-color: #28a745;
}

/* Active Routes */
.active-routes {
    margin-top: 3rem;
}

.active-routes h2 {
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    min-width: 600px; /* Force scroll on small screens */
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    background-color: #fff;
}

.data-table thead th {
    background-color: #343a40;
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table tbody tr:hover {
    background-color: #f1f1f1;
}

thead {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    color: #fff;
}

thead th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #007bff;
    position: relative;
}

thead th:first-child {
    border-top-left-radius: 16px;
}

thead th:last-child {
    border-top-right-radius: 16px;
}

tbody td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 500;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

tbody tr {
    background-color: #ffffff;
    transition: all 0.2s ease;
}

tbody tr:nth-child(4n+1) {
    background-color: #fdfdfd;
}

tbody tr:nth-child(4n+3) {
    background-color: #fdfdfd;
}

.date-picker-container {
    margin-bottom: 1rem;
}

.date-picker-container label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.date-picker-container input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

/* Style for the "+ New Driver" button */
.add-button {
    background-color: #007bff; /* nice blue */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Hover effect for the button */
.add-button:hover {
    background-color: #0056b3; /* darker blue on hover */
}

.day-button.active {
    background-color: #4CAF50; /* Green for active */
    color: white;
}
.day-button {
    transition: background-color 0.3s;
}

.day-buttons-container {
    display: flex;
    flex-wrap: wrap; /* optional: allows wrapping on smaller screens */
    gap: 8px; /* space between buttons */
    justify-content: center; /* center-aligns the buttons */
    margin-top: 10px;
}

.table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
}

.table-controls input,
.table-controls select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #ced4da;
    flex: 1;
    min-width: 200px;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.table-controls input:focus,
.table-controls select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

.table-controls input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.table-wrapper {
    max-height: 500px; /* Adjust as needed */
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
}

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

.table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}
.table-wrapper tbody tr:hover {
    background-color: #f2f2f2;
    cursor: pointer;
}

.responsive-grid {
    flex-direction: row;
    gap: 1rem;
  }

  button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px; /* Slightly more rounded corners for a softer look */
    cursor: pointer;
    transition: background 0.3s;
}

/* Specific overrides for your existing IDs */

.primary-btn {
    background-color: #007bff; /* A modern blue for primary actions */
    color: white;
}

.primary-btn:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

/* Secondary Button Styles (for Cancel) */
.secondary-btn {
    background-color: #6c757d; /* A neutral gray for secondary actions */
    color: white;
}

.secondary-btn:hover {
    background-color: #5a6268; /* Darker gray on hover */
} 

#cancel-btn {
    background-color: #dc3545; /* A standard red for destructive actions */
    /* Overrides the .secondary-btn background if it was applied, ensuring clear 'cancel' color */
}

#cancel-btn:hover {
    background-color: #c82333; /* Darker red on hover */
}

#save-btn {
    background-color: #008CBA;
    color: white;
    margin: 20px auto;
}

#save-btn:hover {
    background-color: #0073a6;
}

.save-btn {
    background-color: #008CBA;
    color: white;
    margin: 20px auto;
}

.save-btn:hover {
    background-color: #0073a6;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    margin: 20px auto;
}

.delete-btn:hover {
    background-color: #c82333;
}

.delete-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.route-grid {
    display: flex;
    flex-direction: row;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.task-list{
    max-height: 400px;
    overflow-y: auto;
    width: 450px;
    -webkit-overflow-scrolling: touch;
}

.task-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-list li {
    background-color: #e9eff6;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    display: block;
    align-items: center;
    justify-content: space-between;
    touch-action: auto;
    min-height: 36px;
    transition: all 0.2s ease;
}

.task-list li:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.task-list li.complete {
    background-color: #ccc;
    color: #666;
}

.task-list li.pickup {
    background-color: #B3CAD7;
}

.task-list li.delivery {
    background-color: #F7D2C4;
}

.driver-selection {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background-color: #FFFFFF;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.driver-selection label {
    font-weight: bold;
    color: #333;
    min-width: 120px;
}

#driver-select {
    flex: 1;
    padding: 8px;
    border: 1px solid #bebebe;
    border-radius: 5px;
    background-color: #e9eff6;
    cursor: pointer;
    min-width: 150px;
}

#assign-driver-btn {
    background-color: #343a40;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.driver-payout-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background-color: #FFFFFF;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.driver-payout-section label {
    font-weight: bold;
    color: #333;
    min-width: 120px;
}

.currency-symbol {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
    flex-shrink: 0;
}

#driver-payout {
    flex: 1;
    padding: 8px;
    border: 1px solid #bebebe;
    border-radius: 5px;
    background-color: #e9eff6;
    font-size: 1rem;
    min-width: 100px;
}

#driver-payout:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

#update-payout-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

#update-payout-btn:hover {
    background-color: #218838;
}

#update-payout-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

#map {
    flex: 1; /* Take remaining width */
    min-height: 375px; /* Ensure it has a minimum height */
    background-color: #eaeaea; /* Placeholder background for map */
}


/* --- Additions/Modifications for QuickBooks Export Page & General Form Styling --- */

/* Card styling for form sections */
.form-section-card {
    background: #ffffff;
    border-radius: 12px; /* Match existing card radius */
    padding: 2rem;    /* More spacious padding */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Match existing card shadow */
    margin-bottom: 2rem;
}

.form-section-card .description {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #555; /* Softer text color */
    line-height: 1.6;
}

/* Form group styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label { /* Replaces .form-group label specific styling */
    display: block;
    font-weight: 600; /* Poppins bold */
    margin-bottom: 0.5rem;
    color: #333; /* Darker label text */
}

/* General input and select styling */
.form-input,
.form-select-multiple {
    width: 100%;
    padding: 0.75rem 1rem; /* Comfortable padding */
    font-size: 1rem;
    font-family: 'Poppins', sans-serif; /* Ensure font consistency */
    border-radius: 8px; /* Slightly more rounded */
    border: 1px solid #ced4da; /* Softer border color */
    background-color: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus,
.form-select-multiple:focus {
    border-color: #007bff; /* Primary blue for focus */
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25); /* Bootstrap-like focus glow */
    outline: none;
}

.form-select-multiple {
    min-height: 160px; /* Good default height for multi-select */
}

/* Helper text for select */
.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875em;
    color: #6c757d; /* Bootstrap's muted text color */
}

/* Controls for client selection (Select All/Deselect All) */
.client-select-controls {
    display: flex;
    gap: 0.75rem; /* Space between buttons */
    margin-top: 0.75rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens if needed */
}

/* General Button Styling (overriding/extending base 'button' if needed) */
/* Your existing 'button' style is a good base. We'll add specific types. */

.button.primary-button {
    background-color: #007bff; /* Primary blue - matches .add-button */
    color: white;
    border: 1px solid #007bff;
}
.button.primary-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
    border-color: #0056b3;
}

.button.secondary-button {
    background-color: #6c757d; /* Bootstrap secondary grey */
    color: white;
    padding: 0.5rem 1rem;    /* Slightly smaller for secondary actions */
    font-size: 0.875rem;   /* Slightly smaller font */
    border: 1px solid #6c757d;
}
.button.secondary-button:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.button.success-button { /* For download link */
    background-color: #28a745; /* Green for success actions */
    color: white;
    border: 1px solid #28a745;
}
.button.success-button:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Container for main form actions */
.form-actions {
    margin-top: 2rem;
    text-align: left; /* Default, or use 'center' or 'right' */
}
.form-actions .button.primary-button {
    padding: 0.75rem 1.5rem; /* Make primary action button a bit larger */
    font-size: 1.1rem;
}


/* Results Section Styling */
#results-section {
    background: #f8f9fa; /* Existing body background, or #e9ecef for contrast */
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    margin-top: 2rem; /* Add some space from the form */
}

#results-section #status-message {
    margin-bottom: 1rem;
    font-weight: 500;
    color: #333;
}

#results-section #download-csv-link.button { /* Ensure download link looks like a button */
    display: inline-block; /* Important for padding and proper button appearance */
    text-decoration: none; /* Remove underline from link */
}

#client-search-input {
    margin-bottom: 0.75rem; /* Space between search and select all buttons */
}

/* Container for the checkbox list */
.client-checkbox-list-container {
    max-height: 250px; /* Adjust as needed */
    overflow-y: auto;  /* Makes it scrollable if content exceeds max-height */
    border: 1px solid #ced4da; /* Matches form-input border */
    border-radius: 8px;       /* Matches form-input border-radius */
    padding: 0.75rem;
    background-color: #fff; /* Ensure background for scrolled content */
}

.client-checkbox-list-container .loading-clients-message,
.client-checkbox-list-container .no-clients-found-message {
    color: #6c757d; /* Muted text color */
    padding: 0.5rem;
    text-align: center;
}

/* Individual client item in the list */
.client-item {
    display: flex; /* Align checkbox and label nicely */
    align-items: center;
    padding: 0.4rem 0.25rem; /* Vertical padding for spacing between items */
    border-bottom: 1px solid #e9ecef; /* Subtle separator */
    transition: background-color 0.15s ease-in-out;
}

.client-item:last-child {
    border-bottom: none; /* No border for the last item */
}

.client-item:hover {
    background-color: #f8f9fa; /* Slight hover effect */
}

.client-item input[type="checkbox"] {
    margin-right: 0.75rem; /* Space between checkbox and label */
    /* Custom checkbox styling can be extensive, for now, rely on browser defaults */
    /* Or use a library / more CSS for custom checkboxes */
    width: 1.15em; /* Adjust size if needed */
    height: 1.15em;
    cursor: pointer;
}

.client-item label {
    font-weight: normal; /* Override .form-label if it was making these bold */
    margin-bottom: 0;  /* Override .form-label or other general label styles */
    color: #333;
    flex-grow: 1; /* Allow label to take available space */
    cursor: pointer; /* Make the label clickable to toggle checkbox */
}

/* Adjustments to client selection controls if needed */
.client-selection-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem; /* Consistent spacing */
}

.input-like-textarea {
    height: 60px; /* Approximate height for 3 lines of text */
    resize: none; /* Prevents resizing */
    overflow-y: auto;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 1200px) {
    .route-grid {
        flex-direction: column;
    }
    .task-list {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .form-section-card {
        padding: 1.5rem;
    }
    .form-actions {
        text-align: center; /* Center button on smaller screens */
    }
    .form-actions .button.primary-button {
        width: 100%; /* Make main action button full-width */
        font-size: 1rem; /* Adjust font size if needed */
        padding: 0.75rem 1rem;
    }
    .client-select-controls {
        flex-direction: column; /* Stack "Select All/None" buttons */
        gap: 0.5rem;
    }
    .client-select-controls .button.secondary-button {
        width: 100%; /* Make them full width when stacked */
    }
    .responsive-grid {
        flex-direction: column;
        justify-content: space-between;
      }
    
    .body {
        max-height: none;
    }  

    .content {
        flex-direction: column;
        max-height: none;
    }

    header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        min-height: 90px;
    }

    .hamburger {
        display: block;
        box-shadow: none;
    }

    .container{
        max-height: none;
    }

    #navbar {
        top: 70px; /* adjust as needed */
        left: 0;
        width: 100%;
        background: #343a40;
        display: none;
        flex-direction: column;
        z-index: 999;
      }
    
      #navbar.active {
        display: flex; /* show side-nav when active */
      }
    
      .side-nav {
        width: 100%;
        padding: 1rem 0;
        height: auto;
      }
    
      .side-nav ul {
        flex-direction: column;
        padding: 0;
        margin: 0;
        width: 100%;
      }
    
      .side-nav ul li {
        width: 100%;
        border-bottom: 1px solid #495057;
      }
    
      .side-nav ul li a {
        display: block;
        width: 100%; /* Ensure full width */
        text-align: center;
        padding: 1rem;
        color: white;
        border-bottom: 1px solid #495057;
        box-sizing: border-box; /* ensure padding doesn't affect the width */
      }

    main {
        padding: 1rem;
        max-height: none;
        overflow-y: auto;
    }

    .data-table {
        min-width: 500px;
    }

    .add-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    .tabs {
        flex-direction: column; /* Stack tabs vertically */
        gap: 0; /* Remove gap between stacked tabs */
        border-bottom: none; /* Remove bottom border from the container */
        margin-bottom: 1rem; /* Adjust margin for overall spacing */
    }
    .tab-button {
        border-radius: 0; /* Remove border-radius on corners for stacked look */
        border-bottom: 1px solid #e0e0e0; /* Add a bottom border to each tab */
        max-width: none !important; /* <--- ADDED !important HERE */
        flex-grow: 1; /* Ensure they expand to full width */
        text-align: center; /* Center the text */
        padding: 0.7rem 1rem; /* Slightly adjust padding for mobile */
        margin-bottom: 0; /* Remove negative margin for stacking */
    }
    .tab-button:last-child {
        border-bottom: none; /* No border for the last tab */
    }
    .tab-button.active {
        border-bottom: 2px solid #007bff; /* Keep active indicator */
        box-shadow: none; /* Remove subtle shadow that looks odd when stacked */
        /* Optionally add a subtle background for active tab */
        background-color: #f8f9fa; /* Lighter background for active */
    }
    .form-section-card {
        padding: 1rem;
    }
    .form-actions {
        flex-direction: column;
        align-items: stretch; /* Stretch buttons to full width */
        gap: 0.75rem;
    }
    .button.primary-button,
    .button.secondary-button,
    .button.danger-button {
        width: 100%;
        padding: 0.75rem 1rem; /* Adjust padding for full-width buttons */
    }
    .logo-upload-box {
        padding: 2rem 1rem;
    }

    /* Mobile responsive styles for driver sections */
    .driver-selection,
    .driver-payout-section {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .driver-selection label,
    .driver-payout-section label {
        min-width: auto;
        margin-bottom: 5px;
    }

    #driver-select {
        min-width: auto;
        width: 100%;
    }

    #driver-payout {
        min-width: auto;
        width: 100%;
    }
    
    #assign-driver-btn,
    #update-payout-btn,
    #recalculate-payout-btn {
        width: 100%;
        margin-top: 10px;
    }
}

/* --- Tabs Styling --- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    gap: 5px; /* Space between tabs */
}

.tab-button {
    background-color: #f0f0f0;
    color: #555;
    border: none;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, border-bottom-color 0.3s ease;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    margin-bottom: -2px; /* Overlap border-bottom of tabs container */
    flex-grow: 1; /* Allow tabs to grow and fill space */
    text-align: center;
    max-width: 200px; /* Limit max width for larger screens */
}

.tab-button:hover {
    background-color: #e9ecef;
    color: #333;
}

.tab-button.active {
    background-color: #ffffff;
    color: #007bff;
    border-bottom: 2px solid #007bff;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05); /* Subtle shadow on active tab */
    z-index: 1; /* Bring active tab to front to hide bottom border overlap */
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s forwards;
}

.tab-content.active {
    display: block;
}

/* --- Form Section Card (renamed from general .card) --- */
.form-section-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

/* --- Form Group Styling --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-input,
.form-select-multiple {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    border: 1px solid #ced4da;
    background-color: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus,
.form-select-multiple:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

.form-select-multiple {
    min-height: 160px;
}

/* Helper text */
.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875em;
    color: #6c757d;
}

/* Form Actions Container */
.form-actions {
    margin-top: 2rem;
    text-align: right; /* Align save buttons to the right */
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Logo Upload Specific Styling */
.logo-upload-box {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    background-color: #fdfdfd;
}

.logo-upload-box:hover,
.logo-upload-box {
    border-color: #007bff;
    background-color: #e6f7ff;
}

.logo-upload-box label {
    display: block;
    cursor: pointer;
    color: #6c757d;
    font-weight: 500;
}

/* Dynamic Content (Vehicle/Service Blocks) */
.vehicle-class-block,
.service-offering-block {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #fefefe;
    position: relative; /* For delete button positioning */
}

.vehicle-class-block:last-of-type,
.service-offering-block:last-of-type {
    margin-bottom: 0; /* No margin after the last one */
}

.vehicle-class-block .form-group,
.service-offering-block .form-group {
    margin-bottom: 1rem; /* Slightly less margin within these dynamic blocks */
}

.delete-button-container {
    position: absolute;
    top: 15px;
    right: 15px;
}

.input-like-textarea {
    height: 90px; /* Approximate height for 3-4 lines of text */
    resize: vertical; /* Allow vertical resizing */
    overflow-y: auto;
    line-height: 1.5;
}

/* Spinner Container */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px; /* Adjust as needed */
    width: 100%;
    position: absolute; /* or relative, depending on your layout */
    top: 0;
    left: 0;
    z-index: 10; /* Ensure it's above other content */
    background-color: white; /* Or a semi-transparent overlay */
}

/* The Spinner Itself */
.spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide the spinner when content is loaded */
.hidden {
    display: none;
}
/* For the content that will fade in */
#content {
    transition: opacity 0.5s ease-in; /* Adjust time as needed */
    opacity: 0; /* Initially hidden */
}

/* When the content is ready to be shown */
#content.loaded {
    opacity: 1;
}

/* Rate per minute container styling */
.rate-per-minute-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rate-per-minute-input {
    width: 50% !important; /* Make input half width */
}

.hourly-calculation {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-weight: 600;
    color: #28a745;
    font-size: 1rem;
}

.hourly-calculation span {
    font-size: 1.1rem;
}

/* Responsive adjustments for rate per minute */
@media (max-width: 768px) {
    .rate-per-minute-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .rate-per-minute-input {
        width: 100% !important;
    }
    
    .hourly-calculation {
        justify-content: center;
        text-align: center;
    }
}

/* Modern Delivery Details Accordion Styling */
.delivery-details-container {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin: 0.5rem 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.delivery-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.card-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.pickup-card .card-header {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    border-bottom-color: #bbdefb;
}

.delivery-card .card-header {
    background: linear-gradient(135deg, #f3e5f5 0%, #ffffff 100%);
    border-bottom-color: #ce93d8;
}

.info-card .card-header {
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
    border-bottom-color: #a5d6a7;
}

.card-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    letter-spacing: -0.025em;
}

.card-content {
    padding: 1.25rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
}

.detail-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.price-highlight {
    color: #28a745;
    font-weight: 700;
    font-size: 1.1rem;
}

.delivery-actions {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.modern-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
    text-decoration: none;
}

.modern-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.4);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.modern-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

.btn-icon {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Responsive adjustments for delivery details */
@media (max-width: 768px) {
    .delivery-details-container {
        padding: 1rem;
    }
    
    .delivery-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .detail-card {
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    
    .card-header {
        padding: 0.875rem 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .detail-item {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .modern-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Enhanced table row hover effect for accordion rows */
.delivery-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.delivery-row:hover {
    background-color: #f8f9fa !important;
}

/* Smooth accordion animation */
.delivery-details {
    transition: all 0.3s ease;
}

.delivery-details td {
    padding: 0 !important;
}

/* Delivery Completion Card Styling */
.delivery-completion-card .card-header {
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
    border-bottom-color: #a5d6a7;
}

.delivery-completion-card {
    border-left: 4px solid #28a745;
}

/* Delivery Photo and Signature Styling */
.delivery-photo-container,
.delivery-signature-container {
    margin-top: 0.5rem;
}

.delivery-photo,
.delivery-signature {
    max-width: 200px;
    max-height: 150px;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.delivery-photo:hover,
.delivery-signature:hover {
    transform: scale(1.05);
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.delivery-signature {
    background-color: #f8f9fa;
    padding: 0.5rem;
}

/* Photo Modal Styling */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
}

.photo-modal-content {
    position: relative;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    text-align: center;
}

.photo-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.2s ease;
}

.photo-modal-close:hover {
    color: #007bff;
}

.photo-modal-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Responsive adjustments for delivery completion */
@media (max-width: 768px) {
    .delivery-photo,
    .delivery-signature {
        max-width: 150px;
        max-height: 100px;
    }
    
    .photo-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .photo-modal-close {
        top: -30px;
        font-size: 28px;
    }
}

/* ============================================
   INVOICING SECTION STYLING
   ============================================ */

/* Payment Method Selector */
.payment-method-selector {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.payment-option {
    position: relative;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-content {
    padding: 1.5rem;
    background: rgba(248, 250, 252, 0.8);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.payment-option:hover .option-content {
    background: rgba(248, 250, 252, 1);
    border-color: #cbd5e0;
    transform: translateX(5px);
}

.payment-option input[type="radio"]:checked + .option-content {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 86, 179, 0.1) 100%);
    border-color: #007bff;
    border-width: 3px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.option-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.option-description {
    margin: 0;
    padding-left: 2.25rem;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Stripe Connect Section */
#stripeConnectSection {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stripe-status-container {
    margin-bottom: 1.5rem;
}

.status-message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.status-message.loading {
    background: rgba(0, 123, 255, 0.1);
    border: 2px solid rgba(0, 123, 255, 0.3);
}

.status-message.info {
    background: rgba(66, 153, 225, 0.1);
    border: 2px solid rgba(66, 153, 225, 0.3);
}

.status-message.warning {
    background: rgba(237, 137, 54, 0.1);
    border: 2px solid rgba(237, 137, 54, 0.3);
}

.status-message.success {
    background: rgba(72, 187, 120, 0.1);
    border: 2px solid rgba(72, 187, 120, 0.3);
}

.status-message.error {
    background: rgba(245, 101, 101, 0.1);
    border: 2px solid rgba(245, 101, 101, 0.3);
}

.status-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.status-message div {
    flex: 1;
}

.status-message strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.status-message p {
    margin: 0.25rem 0;
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}

.status-message .account-id {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #007bff;
    font-weight: 600;
}

/* Status Spinner */
.status-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 123, 255, 0.2);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Stripe Actions */
.stripe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    margin-right: 0.5rem;
}

/* Responsive Design for Invoicing Section */
@media (max-width: 768px) {
    .payment-method-selector {
        gap: 0.75rem;
    }
    
    .option-content {
        padding: 1rem;
    }
    
    .option-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .option-description {
        padding-left: 0;
    }
    
    .stripe-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .stripe-actions button {
        width: 100%;
    }
    
    .status-message {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .option-icon {
        font-size: 1.25rem;
    }
    
    .option-title {
        font-size: 1rem;
    }
    
    .option-description {
        font-size: 0.85rem;
    }

    .min-price-type-content {
        padding: 0.875rem;
    }
    .quote-breakdown-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .quote-breakdown-amount {
        padding-left: 0;
        text-align: left;
    }
}

/* ============================================
   STATUS BADGE STYLING FOR INVOICES
   ============================================ */

.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-unpaid {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-draft {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================
   INVOICE DETAILS PAGE STYLING
   ============================================ */

.invoice-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.invoice-info-section h3,
.invoice-totals-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #007bff;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.95rem;
}

.info-value {
    font-weight: 500;
    color: #333;
    text-align: right;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.total-row:last-child {
    border-bottom: none;
}

.total-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.95rem;
}

.total-value {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.grand-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #007bff !important;
}

.grand-total .total-label {
    font-size: 1.2rem;
    color: #333;
}

.grand-total .total-value {
    font-size: 1.3rem;
    color: #007bff;
    font-weight: 700;
}

.payment-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #28a745;
}

.payment-info .info-row {
    border-bottom: 1px solid #e9ecef;
}

.line-items-section {
    margin-top: 2rem;
}

.line-items-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

/* Clickable row styling for invoice details deliveries */
.clickable-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-row:hover {
    background-color: #f5f5f5 !important;
    transform: translateX(2px);
}

.clickable-row:active {
    background-color: #e9ecef !important;
}

/* Tiered Pricing Styles - Add to admin-home2.css */
.distance-pricing-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-container input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 26px;
    position: relative;
    transition: background-color 0.3s;
    margin-right: 12px;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-container input[type="checkbox"]:checked + .toggle-slider {
    background-color: #007bff;
}

.toggle-container input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 500;
    color: #333;
}

.card .toggle-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    width: auto; /* Override the .card label width: 100% */
    margin: 0; /* Override the .card label margin */
}

.card .toggle-container .toggle-label {
    display: inline; /* Override display: block from .card label */
    width: auto; /* Override width: 100% from .card label */
    margin: 0; /* Override margin from .card label */
    font-weight: 500;
    color: #333;
}

.form-helper-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.pricing-tier {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.pricing-tier.tier-secondary {
    background: linear-gradient(135deg, #f0f7ff 0%, #f8f9fa 100%);
    border-color: #007bff30;
}

.tier-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.tier-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.tier-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.tier-content .form-group:last-child {
    margin-bottom: 0;
}

.pricing-preview {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.preview-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2e7d32;
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preview-input-group label {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.preview-input {
    width: 120px !important;
    flex-shrink: 0;
}

.preview-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
}

.preview-label {
    font-weight: 500;
    color: #555;
}

.preview-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2e7d32;
}

.preview-breakdown {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item.breakdown-total {
    border-top: 2px solid #2e7d32;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-weight: 600;
}

.breakdown-description {
    color: #555;
}

.breakdown-amount {
    font-weight: 500;
    color: #333;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.min-price-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.min-price-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
}

.min-price-type-option {
    position: relative;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.min-price-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.min-price-type-content {
    padding: 1.25rem;
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.min-price-type-option:hover .min-price-type-content {
    background: #ffffff;
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.min-price-type-option input[type="radio"]:checked + .min-price-type-content {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08) 0%, rgba(0, 86, 179, 0.08) 100%);
    border-color: #007bff;
    border-width: 2px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.15);
}

.min-price-type-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.min-price-type-icon {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.min-price-type-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.min-price-type-option input[type="radio"]:checked + .min-price-type-content .min-price-type-title {
    color: #007bff;
}

.min-price-type-description {
    margin: 0;
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.5;
    flex-grow: 1;
}

/* Override card label styles within the selector */
.card .min-price-type-option {
    display: block;
    width: auto;
    margin: 0;
    font-weight: normal;
    color: inherit;
}

.quote-calculator-card {
    border: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.quote-calculator-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid #e9ecef;
}

.quote-calculator-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.quote-calculator-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    color: #333;
}

.quote-calculator-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.quote-calculator-inputs {
    margin-bottom: 1.5rem;
}

.quote-input-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.quote-input-row:last-child {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0;
}

/* Quote Result Container */
.quote-result-container {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0f9ff 100%);
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    overflow: hidden;
}

.quote-result-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #065f46 0%, #064e3b 100%);
    color: white;
}

.quote-result-label {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.quote-result-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Quote Breakdown */
.quote-breakdown {
    padding: 0.75rem 0;
}

.quote-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background-color 0.15s ease;
}

.quote-breakdown-row:last-child {
    border-bottom: none;
}

.quote-breakdown-row:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.quote-breakdown-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.quote-breakdown-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.quote-breakdown-desc {
    font-size: 0.82rem;
    color: #6c757d;
    line-height: 1.3;
}

.quote-breakdown-amount {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    white-space: nowrap;
    padding-left: 1rem;
    text-align: right;
    min-width: 80px;
}

/* Row type styles */
.quote-breakdown-info {
    background-color: transparent;
}

.quote-breakdown-info .quote-breakdown-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.85rem;
}

.quote-breakdown-info .quote-breakdown-desc {
    color: #333;
    font-weight: 500;
}

.quote-breakdown-info-bold {
    background-color: rgba(0, 123, 255, 0.04);
    border-bottom: 2px solid rgba(0, 123, 255, 0.15) !important;
}

.quote-breakdown-info-bold .quote-breakdown-label {
    font-weight: 600;
    color: #007bff;
    font-size: 0.88rem;
}

.quote-breakdown-info-bold .quote-breakdown-desc {
    color: #007bff;
    font-weight: 600;
}

/* Line items (time cost, distance cost) */
.quote-breakdown-row.quote-breakdown-row:not(.quote-breakdown-info):not(.quote-breakdown-info-bold):not(.quote-breakdown-subtotal):not(.quote-breakdown-adjustment):not(.quote-breakdown-adjustment-none):not(.quote-breakdown-surcharge):not(.quote-breakdown-total) .quote-breakdown-amount {
    color: #333;
}

/* Subtotal */
.quote-breakdown-subtotal {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 2px solid #dee2e6 !important;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.quote-breakdown-subtotal .quote-breakdown-label {
    font-weight: 700;
    font-size: 0.92rem;
}

.quote-breakdown-subtotal .quote-breakdown-amount {
    font-weight: 700;
}

/* Adjustment (min price or base rate applied) */
.quote-breakdown-adjustment {
    background-color: rgba(255, 193, 7, 0.08);
    border-left: 3px solid #ffc107;
}

.quote-breakdown-adjustment .quote-breakdown-label {
    color: #856404;
}

.quote-breakdown-adjustment .quote-breakdown-desc {
    color: #856404;
}

.quote-breakdown-adjustment .quote-breakdown-amount {
    color: #856404;
    font-weight: 700;
}

/* No adjustment needed */
.quote-breakdown-adjustment-none {
    background-color: rgba(40, 167, 69, 0.05);
}

.quote-breakdown-adjustment-none .quote-breakdown-label {
    color: #28a745;
    font-weight: 500;
}

.quote-breakdown-adjustment-none .quote-breakdown-desc {
    color: #6c757d;
    font-style: italic;
}

.quote-breakdown-adjustment-none .quote-breakdown-amount {
    color: #28a745;
}

/* Surcharges */
.quote-breakdown-surcharge {
    background-color: rgba(0, 123, 255, 0.04);
}

.quote-breakdown-surcharge .quote-breakdown-label {
    color: #0056b3;
}

.quote-breakdown-surcharge .quote-breakdown-amount {
    color: #0056b3;
}

/* Final total */
.quote-breakdown-total {
    background: linear-gradient(135deg, #065f46 0%, #064e3b 100%);
    padding: 1rem 1.5rem;
    border-bottom: none !important;
}

.quote-breakdown-total .quote-breakdown-label {
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
}

.quote-breakdown-total .quote-breakdown-amount {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}


/* Responsive adjustments for invoice details */
@media (max-width: 768px) {
    .invoice-header-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-row,
    .total-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .info-value,
    .total-value {
        text-align: left;
    }
    .preview-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .preview-input {
        width: 100% !important;
    }

    .min-price-type-selector {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .min-price-type-content {
        padding: 1rem;
    }
    
    .min-price-type-header {
        gap: 0.5rem;
    }
    
    .min-price-type-icon {
        font-size: 1.1rem;
    }
    
    .min-price-type-title {
        font-size: 0.95rem;
    }
    
    .min-price-type-description {
        font-size: 0.8rem;
    }
    .quote-input-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .quote-input-row:last-child {
        grid-template-columns: 1fr;
    }

    .quote-calculator-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .quote-result-total {
        padding: 1rem;
    }

    .quote-result-value {
        font-size: 1.5rem;
    }

    .quote-breakdown-row {
        padding: 0.5rem 1rem;
    }

    .quote-breakdown-total {
        padding: 0.75rem 1rem;
    }

    .quote-breakdown-amount {
        min-width: 70px;
        font-size: 0.9rem;
    }
}

.time-pricing-section {
    margin-bottom: 0.5rem;
}

.time-pricing-section .subsection-title {
    margin-bottom: 1rem;
}

/* Time tier card variant */
.pricing-tier.tier-time {
    background: linear-gradient(135deg, #fff8f0 0%, #f8f9fa 100%);
    border-color: rgba(255, 152, 0, 0.2);
}

.pricing-tier.tier-time .tier-header {
    border-bottom: 1px solid rgba(255, 152, 0, 0.15);
    padding-bottom: 0.75rem;
}

/* Ensure helper text within tier cards is styled consistently */
.pricing-tier .form-helper-text {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.82rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Hourly calculation box within tier card — ensure it fits */
.pricing-tier .rate-per-minute-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pricing-tier .rate-per-minute-input {
    width: 50% !important;
}

.pricing-tier .hourly-calculation {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: rgba(40, 167, 69, 0.08);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    font-weight: 600;
    color: #28a745;
    font-size: 1rem;
}

/* ============================================
   ROUTE PRICE FLOOR TIER CARD
   ============================================ */

.pricing-tier.tier-floor {
    background: linear-gradient(135deg, #f5f0ff 0%, #f8f9fa 100%);
    border-color: rgba(102, 126, 234, 0.2);
}

.pricing-tier.tier-floor .tier-header {
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    padding-bottom: 0.75rem;
}

/* ============================================
   PRICING SUMMARY DESCRIPTION BOX
   ============================================ */

.pricing-summary-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.pricing-summary-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #eef1f5 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1.25rem;
}

.pricing-summary-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pricing-summary-icon {
    font-size: 1.3rem;
    margin-right: 0.6rem;
}

.pricing-summary-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.pricing-summary-box p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

/* ============================================
   CONSISTENT TIER CARD REFINEMENTS
   ============================================ */

/* Add subtle header divider to all tier cards */
.pricing-tier .tier-header {
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Consistent last form-group spacing in all tiers */
.pricing-tier .tier-content .form-group:last-child {
    margin-bottom: 0;
}

/* Subsection titles — consistent spacing between all sections */
.distance-pricing-section .subsection-title,
.min-price-section .subsection-title,
.time-pricing-section .subsection-title {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

/* Ensure min-price-section tier card has consistent top margin */
.min-price-section .pricing-tier {
    margin-top: 1rem;
}

/* Consistent section spacing */
.time-pricing-section,
.distance-pricing-section,
.min-price-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

/* First section doesn't need top border */
.time-pricing-section {
    border-top: none;
    margin-top: 0.5rem;
    padding-top: 0;
}

.distance-pricing-section,
.min-price-section {
    border-top: 1px solid #e9ecef;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS FOR TIME SECTION
   ============================================ */

@media (max-width: 768px) {
    .pricing-tier .rate-per-minute-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .pricing-tier .rate-per-minute-input {
        width: 100% !important;
    }

    .pricing-tier .hourly-calculation {
        justify-content: center;
        text-align: center;
    }
}

/* ============================================
   DRAG & DROP STYLES
   ============================================ */

/* Desktop: element being dragged via native drag API */
.task-list li.drag-source {
    opacity: 0.4;
    background-color: #d0d8e0 !important;
    border: 2px dashed #94a3b8;
    border-radius: 8px;
}

/* Touch: original element hidden while ghost is visible */
.task-list li.drag-hidden {
    opacity: 0;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    border: none !important;
}

/* Placeholder showing where the item will land */
.task-list li.drag-placeholder {
    background: linear-gradient(135deg, #e6f0ff 0%, #dbeafe 100%);
    border: 2px dashed #007bff;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: height 0.15s ease;
    box-sizing: border-box;
}

/* Ghost element that follows the finger */
.drag-ghost {
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: inherit;
    padding: 10px;
    background-color: #ffffff !important;
    border: 2px solid #007bff;
}

.drag-ghost.pickup {
    background-color: #B3CAD7 !important;
    border-color: #007bff;
}

.drag-ghost.delivery {
    background-color: #F7D2C4 !important;
    border-color: #007bff;
}

/* Prevent text selection during drag */
.task-list.is-dragging {
    user-select: none;
    -webkit-user-select: none;
}

/* Smooth transitions for items shifting around */
.task-list ul li {
    transition: transform 0.15s ease;
}

/* Remove transition during active drag to prevent jank */
.task-list ul li.drag-hidden,
.task-list ul li.drag-source {
    transition: none;
}

/* Make sure task text wraps in a span for clean renumbering */
.task-text {
    display: inline;
}

/* Ensure buttons in task details don't trigger drag */
.task-details button {
    touch-action: manipulation;
}

/* Override the old dragging class */
.dragging {
    opacity: 0.4;
    background-color: #d0d8e0 !important;
}

#recalculate-payout-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

#recalculate-payout-btn:hover {
    background-color: #0056b3;
}

#recalculate-payout-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* ============================================
   NEW ROUTE PAGE STYLES
   ============================================ */

/* Route Controls Section */
.route-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Enhanced Route Controls Section */
.route-controls-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.route-controls-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

.route-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.route-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-control-group label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Time Input Styling */
.route-control-group input[type="time"] {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.route-control-group input[type="time"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.route-control-group input[type="time"]:hover {
    border-color: #b8daff;
    background-color: #fafafa;
}

/* Enhanced Description Textarea Styling */
.route-control-group textarea {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    min-height: 80px;
    resize: vertical;
}

.route-control-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.route-control-group textarea:hover {
    border-color: #b8daff;
    background-color: #fafafa;
}

.route-control-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.route-control-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.save-start-time-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: 1px solid #20c997;
}

.save-start-time-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(32, 201, 151, 0.3);
}

.save-description-btn {
    background: linear-gradient(135deg, #007bff, #6610f2);
    color: white;
    border: 1px solid #6610f2;
}

.save-description-btn:hover {
    background: linear-gradient(135deg, #6610f2, #007bff);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 16, 242, 0.3);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-badge.pending {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-color: #ffeaa7;
}

.status-badge.available {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-color: #c3e6cb;
}

.status-badge.calculated {
    background: linear-gradient(135deg, #cce5ff, #b3d7ff);
    color: #004085;
    border-color: #b3d7ff;
}

.status-badge.order-set {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-color: #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .route-controls-grid {
        grid-template-columns: 1fr;
    }
    
    .route-control-actions {
        flex-direction: column;
    }
    
    .route-control-actions button {
        width: 100%;
    }
}

.route-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.status-badge.pending {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.status-badge.calculated {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.status-badge.order-set {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.status-badge.available {
    background-color: #e2f0d9;
    color: #155724;
    border-color: #b8e6c1;
}

.claim-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
}

.claim-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.claim-btn.unavailable {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    cursor: not-allowed;
}

.claim-btn.unavailable:hover {
    transform: none;
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
}

.route-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Route Details Section */
.route-details-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.route-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.route-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.route-detail-item label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.route-detail-item input[type="datetime-local"],
.route-detail-item textarea {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
    border: 1px solid #ced4da;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.route-detail-item input[type="datetime-local"]:focus,
.route-detail-item textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

.small-btn {
    align-self: flex-start;
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.small-btn:hover {
    background-color: #5a6268;
}

.small-btn:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
}

/* Driver Section */
.driver-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Enhanced driver selection styling */
.driver-selection {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

.driver-selection label {
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

#driver-select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    min-width: 150px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#driver-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

#assign-driver-btn {
    background-color: #343a40;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#assign-driver-btn:hover {
    background-color: #23272b;
}

#assign-driver-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Enhanced driver payout section */
.driver-payout-section {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.driver-payout-section label {
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

#driver-payout {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    font-size: 1rem;
    min-width: 100px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#driver-payout:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

#update-payout-btn,
#recalculate-payout-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#update-payout-btn:hover,
#recalculate-payout-btn:hover {
    background-color: #218838;
}

#update-payout-btn:disabled,
#recalculate-payout-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Route Grid */
.route-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

#map {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.task-list {
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.task-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-list li {
    background-color: #e9eff6;
    border-radius: 8px;
    padding: 0.75rem; /* Reduced padding */
    margin-bottom: 0.5rem; /* Reduced margin */
    display: block;
    align-items: center;
    justify-content: space-between;
    touch-action: auto;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    min-height: 40px; /* Reduced minimum height */
}

.task-list li:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.task-list li.complete {
    background-color: #f8f9fa;
    color: #6c757d;
    border-left-color: #6c757d;
}

.task-list li.pickup {
    background-color: #e3f2fd;
    border-left-color: #2196f3;
}

.task-list li.delivery {
    background-color: #f3e5f5;
    border-left-color: #9c27b0;
}

/* Task Details Styling */
.task-details {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-out;
}

.task-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.task-buttons button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.complete-task-btn {
    background-color: #28a745;
    color: white;
}

.complete-task-btn:hover {
    background-color: #218838;
}

.remove-task-btn {
    background-color: #dc3545;
    color: white;
}

.remove-task-btn:hover {
    background-color: #c82333;
}

.track-task-btn {
    background-color: #007bff;
    color: white;
}

.track-task-btn:hover {
    background-color: #0056b3;
}

/* Drive Time Display */
.drive-time {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #e9ecef;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .route-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .route-actions {
        justify-content: center;
        width: 100%;
    }

    .route-details-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .route-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .task-list {
        max-height: 300px;
    }

    .driver-section {
        padding: 1rem;
    }

    .driver-selection,
    .driver-payout-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .driver-selection label,
    .driver-payout-section label {
        min-width: auto;
        margin-bottom: 0.5rem;
    }

    #driver-select {
        min-width: auto;
        width: 100%;
    }

    #driver-payout {
        min-width: auto;
        width: 100%;
    }

    #assign-driver-btn,
    #update-payout-btn,
    #recalculate-payout-btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    .small-btn {
        width: 100%;
    }

    .task-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}

.readiness-panel {
    margin-top: 12px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 0.9rem;
}

.readiness-header {
    font-weight: 600;
    margin-bottom: 6px;
    color: #856404;
}

.readiness-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.readiness-list li {
    padding: 4px 0;
    color: #856404;
}

.readiness-list li::before {
    content: "• ";
    margin-right: 4px;
}

.claim-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-badge.available {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.pending {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-badge.claimed {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.task-eta {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
    margin-left: 4px;
}
/* ===== Section header layout ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ===== Driver count badge ===== */
.driver-count-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}

.driver-count-badge.within-limit {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.driver-count-badge.at-limit {
    background-color: #fff3e0;
    color: #e65100;
}

/* ===== Limit warning banner ===== */
.limit-banner {
    border: 1px solid #ffcc02;
    background-color: #fffde7;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.limit-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.limit-banner-icon {
    flex-shrink: 0;
    color: #f9a825;
    margin-top: 1px;
}

.limit-banner-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.45;
}

.limit-upgrade-link {
    color: #1565c0;
    text-decoration: underline;
    font-weight: 600;
}

.limit-upgrade-link:hover {
    color: #0d47a1;
}

/* ===== Disabled add button ===== */
.add-button:disabled,
.add-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== Utility ===== */
.hidden {
    display: none !important;
}