/* Global Styles */
:root {
    --primary-color: #e5233d;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --gradient-primary: linear-gradient(135deg, #B7152B 0%, #800F1E 100%);
}

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

textarea {
    resize: vertical;
}

/* Form input styling - gray background and subtle shadow */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
select,
textarea {
    background-color: #F9FAFB;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.dashboard-section > .table-container {
    margin: 0 -1.5rem -1.5rem -1.5rem;
}

/* Navigation */
.navbar {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.nav-logo {
    height: 40px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--dark-color);
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle:hover {
    background-color: var(--light-color);
    border-radius: 0.375rem;
}

.nav-item {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--secondary-color);
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.nav-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    background-color: rgba(229, 35, 61, 0.08);
}

/* Navigation dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--secondary-color);
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-size: 0.875rem;
}

.dropdown-toggle:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.dropdown-toggle.active {
    color: var(--primary-color);
    background-color: rgba(229, 35, 61, 0.08);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 0.5rem 0;
}

.nav-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    color: var(--dark-color);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.dropdown-item.active {
    background-color: rgba(229, 35, 61, 0.08);
    color: var(--primary-color);
}

/* Alerts indicator - always visible */
.alerts-indicator {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    margin-left: auto;
    padding: 0 0.5rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.alert-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.alert-icon {
    color: var(--secondary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#logoutBtn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
}

#logoutBtn:hover {
    background-color: var(--dark-color);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.view {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.view.active {
    display: block;
    opacity: 1;
}

.dashboard-header,
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h2,
.view-header h2 {
    font-size: 2rem;
    color: var(--dark-color);
}

.date-time {
    color: var(--secondary-color);
}

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

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-card.alert {
    border-left: 4px solid var(--danger-color);
}

.metric-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
}

/* Dashboard Sections */
.dashboard-section {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Dashboard Panels */
.dashboard-panel {
    background: white;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    user-select: none;
}

.panel-header:hover {
    background-color: #e2e8f0;
}

.panel-header h3 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.25rem;
}

.panel-toggle-icon {
    font-size: 1.25rem;
    color: var(--secondary-color);
    transition: transform 0.3s ease;
}

.dashboard-panel.collapsed .panel-toggle-icon {
    transform: rotate(-90deg);
}

.panel-content {
    padding: 1.5rem;
}

.panel-content.tight {
    padding: 0;
}

.dashboard-panel.collapsed .panel-content {
    display: none;
}

/* Alerts List */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--light-color);
    border-radius: 0.375rem;
    border-left: 3px solid transparent;
}

.alert-item.critical {
    border-left-color: var(--danger-color);
    background-color: #fef2f2;
}

.alert-item.high {
    border-left-color: var(--warning-color);
    background-color: #fffbeb;
}

.alert-item.medium {
    border-left-color: var(--primary-color);
    background-color: #eff6ff;
}

.alert-content {
    flex-grow: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.alert-time {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.data-table th {
    background-color: var(--light-color);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background-color: var(--light-color);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    align-self: start;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-badge.in_progress {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.dispatched {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.waiting {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.status-badge.ready_for_pickup {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.ready_to_bill {
    background-color: #d1fae5;
    color: #047857;
}

.status-badge.billing_sent {
    background-color: #e0e7ff;
    color: #4338ca;
}

.status-badge.overdue {
    background-color: #fee2e2;
    color: #dc2626;
}

.status-badge.paid {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.on_hold {
    background-color: #6b7280;
    color: #f9fafb;
}

.status-badge.active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-badge.expired {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Callouts */
.callout {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.callout-info {
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.callout-warning {
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #b91c2c;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-document {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-document:hover:not(:disabled) {
    background-color: #b91c2c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-document:disabled {
    background-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-document svg {
    flex-shrink: 0;
}

.document-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.document-item {
    display: flex;
    gap: 0.5rem;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-doc-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background-color: var(--light-color);
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-doc-action:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-doc-action svg {
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--secondary-color);
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    background-color: #F9FAFB;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.form-group rmt-select {
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 35, 61, 0.1);
}

/* Input with Unit Suffix */
.input-with-unit {
    display: flex;
    align-items: stretch;
    position: relative;
    width: 100%;
}

/* Align unlabeled inputs with labeled inputs in form rows */
.form-group > .input-with-unit {
    margin-top: calc(1.5em + 0.375rem);
}

@media (max-width: 768px) {
    .form-group > .input-with-unit {
        margin-top: 0;
    }
}

.input-with-unit input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-with-unit .input-unit {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: #F9FAFB;
    border: 1px solid var(--border-color);
    border-left: none;
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 50px;
    justify-content: center;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.input-with-unit input:focus {
    border-right: none;
}

.input-with-unit input:focus + .input-unit {
    border-color: var(--primary-color);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: white;
}

/* Dispatch Board */
.dispatch-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dispatch-column {
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dispatch column background colors */
.dispatch-column:nth-child(1) {
    /* Pending - Light gray */
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-left: 4px solid #6b7280;
}

.dispatch-column:nth-child(2) {
    /* In Progress - Light orange/yellow */
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #f59e0b;
}

.dispatch-column:nth-child(3) {
    /* Waiting - Light purple */
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-left: 4px solid #a855f7;
}

.dispatch-column:nth-child(4) {
    /* Ready for Pickup - Light blue */
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #3b82f6;
}

.dispatch-column:nth-child(5) {
    /* Completed - Light green */
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #22c55e;
}

.dispatch-column:nth-child(6) {
    /* Ready to Bill - Light teal */
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border-left: 4px solid #14b8a6;
}

.dispatch-column:nth-child(7) {
    /* Billing Sent - Light indigo */
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-left: 4px solid #6366f1;
}

.dispatch-column:nth-child(8) {
    /* Overdue - Light red */
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #ef4444;
}

.dispatch-column h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.dispatch-column h4 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.dispatch-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dispatch-card {
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    cursor: move;
    transition: all 0.2s;
}

.dispatch-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dispatch-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dispatch-card-container {
    font-weight: 600;
    color: var(--dark-color);
}

.dispatch-card-type {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.dispatch-card-details {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0);
    z-index: 2000;
    transition: background-color 0.2s ease;
}

.modal-overlay.active {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 2001;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--dark-color);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.modal-close-btn:hover {
    background-color: var(--light-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* POD Modal Specific Styles */
.pod-modal {
    max-width: 700px;
}

.signature-container {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: #fafafa;
    padding: 0.5rem;
}

#podSignatureCanvas {
    width: 100%;
    height: 200px;
    border: 1px dashed var(--border-color);
    border-radius: 0.375rem;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.btn-clear-signature {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.btn-clear-signature:hover {
    background: #475569;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.required {
    color: var(--danger-color);
    margin-left: 0.25rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* .modal-close is now a functional class only - styling is on .modal-close-btn */

/* Login Page Styles */
.login-page {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.login-header {
    background: white;
    padding: 2rem;
    text-align: center;
    color: var(--dark-color);
}

.login-logo {
    max-width: 300px;
    height: auto;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.875rem;
}

.login-body {
    padding: 2rem;
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.success-message.show {
    display: block;
}

.role-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.role-btn {
    flex: 1;
    padding: 0.5rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.role-btn.active {
    background: #fef2f2;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.forgot-password {
    text-align: center;
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Driver Portal Styles */
.driver-page {
    padding-bottom: 80px; /* Space for FAB */
}

.driver-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b91c2c 100%);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.driver-logo {
    height: 35px;
    width: auto;
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Active Load Banner */
.active-load-banner {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.banner-label {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.container-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.load-details {
    font-size: 0.875rem;
    opacity: 0.95;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 60px;
    z-index: 90;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--dark-color);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 1rem;
    min-height: calc(100vh - 300px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tab-content.active {
    opacity: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--dark-color);
    opacity: 0.5;
}

.empty-state svg {
    margin-bottom: 1rem;
}

/* Leg Details */
.leg-details {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.leg-details h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Load Information Card */
.load-info-card {
    background: var(--light-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.load-info-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.load-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.95rem;
    color: var(--dark-color);
    font-weight: 600;
}

.info-value.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.leg-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.location-card {
    flex: 1;
    padding: 0.75rem;
    background-color: var(--light-color);
    border-radius: 0.5rem;
    text-align: center;
}

.location-label {
    font-size: 0.75rem;
    color: var(--dark-color);
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

.location-name {
    font-weight: 600;
    color: var(--dark-color);
}

.location-address {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
    line-height: 1.3;
}

.arrow {
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Status Buttons */
.status-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-status {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start {
    background-color: var(--primary-color);
    color: white;
}

.btn-arrive {
    background-color: var(--success-color);
    color: white;
}

.btn-arrive:hover {
    background-color: #0d9668;
}

.btn-complete {
    background-color: var(--success-color);
    color: white;
}

/* Directions Buttons Container */
.directions-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .directions-buttons {
        grid-template-columns: 1fr;
    }
}

.btn-directions {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Document Section */
.document-section {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
}

.document-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--light-color);
    border-radius: 0.5rem;
}

.doc-type {
    font-weight: 600;
    color: var(--dark-color);
}

.btn-upload {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Signature Section */
.signature-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.signature-section h4 {
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

#signatureCanvas {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    margin-bottom: 0.75rem;
}

.signature-controls {
    display: flex;
    gap: 0.5rem;
}

/* Loads List */
.loads-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.load-card {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.load-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.load-card-container {
    font-weight: 600;
    color: var(--dark-color);
}

.load-card-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-dispatched {
    background-color: #fef3c7;
    color: #92400e;
}

.status-in-transit {
    background-color: #e0e7ff;
    color: #3730a3;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--dark-color);
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#pageInfo {
    font-size: 0.875rem;
    color: var(--dark-color);
    font-weight: 500;
}

.leg-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
    border-top: 1px dashed var(--border-color);
}

.leg-item:first-child {
    border-top: none;
    padding-top: 0;
}

.leg-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--primary-color);
}

.leg-origin,
.leg-destination {
    font-size: 0.875rem;
    color: var(--dark-color);
}

.leg-origin::before {
    content: "From: ";
    font-weight: 500;
}

.leg-destination::before {
    content: "To: ";
    font-weight: 500;
}

.leg-completed-date {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-style: italic;
}

.leg-pay {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success-color);
}

/* Settlements List */
.settlements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.paystub-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.paystub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
}

.paystub-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.paystub-date {
    font-size: 0.75rem;
    opacity: 0.9;
}

.paystub-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.paystub-body {
    padding: 0.75rem 1rem;
}

.paystub-line-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.paystub-line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

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

.line-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.line-item-load {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--dark-color);
}

.line-item-type {
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: capitalize;
}

.line-item-pay {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.line-item-desc {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.line-item-amount {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark-color);
}

.paystub-footer {
    padding: 1rem;
    background: var(--light-gray);
    border-top: 2px solid var(--border-color);
}

.paystub-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark-color);
}

.total-amount {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--success-color);
}

.paystub-settler {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.paystub-notes {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--background-color, #f8fafc);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-secondary, #64748b);
}

.paystub-line-item .line-item-amount.negative {
    color: var(--danger-color);
}

.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
}

/* Messages */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 4rem;
}

.message-item {
    background: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-item.sent {
    background-color: var(--primary-color);
    color: white;
    margin-left: 2rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

.message-body {
    font-size: 0.875rem;
}

.message-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

#messageInput {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

.btn-send {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.document-card {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.document-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.document-name {
    font-size: 0.875rem;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.document-date {
    font-size: 0.75rem;
    color: var(--dark-color);
    opacity: 0.6;
}

/* FAB and Quick Actions */
.fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #b91c2c 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.2s;
}

.fab:active {
    transform: scale(0.95);
}

.quick-actions-menu {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    display: none;
    z-index: 999;
}

.quick-actions-menu.show {
    display: block;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.quick-action:hover {
    background-color: var(--light-color);
    border-radius: 0.375rem;
}

.mobile-user-section {
    display: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.report-card {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.report-card h3 {
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.report-card p {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.report-card .btn-primary {
    width: 100%;
}

/* Admin table styling */
.role-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: white;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.role-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229, 35, 61, 0.1);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 16px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-info {
    background-color: #3b82f6;
}

.toast-success {
    background-color: #10b981;
}

.toast-warning {
    background-color: #f59e0b;
}

.toast-error {
    background-color: #ef4444;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--secondary-color);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 500;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.empty-state .btn-primary {
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    /* Mobile menu overlay - covers page content */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 998;
    }

    body.menu-open::after {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
        z-index: 999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        transform: translateY(-10px);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .nav-menu.show {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

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

    /* Hide nav-user on mobile but keep alerts visible */
    .nav-user {
        display: none !important;
    }

    /* Hide date-time on mobile to save space */
    .date-time {
        display: none !important;
    }

    /* Hide alerts indicator on mobile */
    .alerts-indicator {
        display: none !important;
    }

    /* Style the mobile user section inside nav-menu */
    .mobile-user-section {
        display: flex;
        width: 100%;
        padding: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        gap: 1rem;
    }

    .mobile-user-section .user-info {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-user-section #userName {
        display: block !important;
        font-weight: 500;
    }

    .mobile-user-section #mobileLogoutBtn,
    .mobile-user-section button {
        display: inline-block !important;
        background-color: var(--secondary-color);
        color: white;
        border: none;
        padding: 0.375rem 0.75rem;
        border-radius: 0.375rem;
        cursor: pointer;
        font-size: 0.875rem;
    }

    .mobile-user-section #mobileLogoutBtn:hover {
        background-color: var(--dark-color);
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

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

    .filters-bar {
        flex-direction: column;
    }

    .modal {
        width: 95%;
    }

    /* Admin dropdown mobile styles */
    .dropdown-toggle {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
    }

    .dropdown-item {
        text-align: center;
    }
}

@media (max-width: 640px) {
    .login-container {
        margin: 1rem;
    }
}

/* Driver Portal Responsive */
@media (min-width: 768px) {
    .driver-page {
        max-width: 768px;
        margin: 0 auto;
    }

    .documents-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Invoice Detail View Styles */
.detail-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0.875rem;
    width: auto;
    align-self: flex-start;
}

.back-link:hover {
    color: var(--dark-color);
    text-decoration: underline;
}

.detail-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-title h2 {
    margin: 0;
    color: var(--dark-color);
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.detail-card {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-color);
}

.card-header h3 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.25rem;
}

.card-content {
    padding: 1.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

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

.detail-item label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-item span {
    font-size: 1rem;
    color: var(--dark-color);
}

#summaryTotal {
    font-weight: 700;
    color: var(--primary-color);
}

.billing-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.billing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billing-item label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.billing-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    text-align: right;
}

.billing-value.positive {
    color: #059669;
}

.billing-value.negative {
    color: #dc2626;
}

/* Billing Receipt Styles */
.billing-receipt {
    display: flex;
    flex-direction: column;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.receipt-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.receipt-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.receipt-value.negative {
    color: #dc2626;
}

.receipt-item.receipt-subtotal {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.receipt-item.receipt-total {
    padding: 0.75rem 0;
    border-top: 2px solid var(--dark-color);
    border-bottom: 1px solid var(--border-color);
}

.receipt-item.receipt-total .receipt-label,
.receipt-item.receipt-total .receipt-value {
    font-size: 1.125rem;
    font-weight: 700;
}

.receipt-item.receipt-total .receipt-value.positive {
    color: #059669;
}

.receipt-item.receipt-total .receipt-value.negative {
    color: #dc2626;
}

.receipt-item.receipt-margin {
    padding-top: 0.5rem;
}

.receipt-item.receipt-margin .receipt-label {
    font-style: italic;
}

.receipt-item.receipt-margin .receipt-value.positive {
    color: #059669;
}

.receipt-item.receipt-margin .receipt-value.negative {
    color: #dc2626;
}

/* Only span 2 columns on desktop */
@media (min-width: 769px) {
    .summary-card-double {
        grid-column: span 2;
    }
}

.direction-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.direction-badge.import {
    background-color: #dbeafe;
    color: #1e40af;
}

.direction-badge.export {
    background-color: #fef3c7;
    color: #d97706;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* Wide Modal Styles */
.modal-wide {
    max-width: 90vw;
    width: 800px;
}

.modal-wide .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

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

.form-row.full-width {
    grid-template-columns: 1fr;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Route Map */
.route-map {
    width: 100%;
    height: 300px;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Load Summary Map */
.load-summary-map {
    width: 100%;
    height: 450px;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.toggle-btn {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark-color);
    transition: all 0.2s;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    background: var(--border-color);
}

.toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.additional-locations {
    display: none;
}

.additional-locations.show {
    display: block;
}

/* Location Timeline Styles */
.location-timeline {
    position: relative;
    padding-left: 2rem;
}

.location-timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 1rem;
    bottom: 1rem;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

/* Only remove margin-bottom from the very last timeline item if it's an add-location button */
.timeline-item.add-location:last-child {
    margin-bottom: 0;
}

/* Keep margin for optional-location and required-location items even if they're last */
.timeline-item.optional-location,
.timeline-item.required-location {
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: calc(-2rem + 0.75rem + 1px);
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-color);
    z-index: 1;
}

.required-location .timeline-dot {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 35, 61, 0.15);
}

.add-location .timeline-dot {
    background: white;
    border: 2px dashed var(--secondary-color);
}

.timeline-content {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.required-location .timeline-content {
    background: rgba(229, 35, 61, 0.03);
    border-color: var(--primary-color);
}

.optional-location .timeline-content {
    background: white;
}

.add-location .timeline-content {
    background: transparent;
    border: none;
    padding: 0;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.location-header label {
    margin-bottom: 0;
    font-weight: 600;
    color: var(--dark-color);
}

.btn-add-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 2px dashed var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
}

.btn-add-location:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(229, 35, 61, 0.03);
}

.btn-add-location .plus-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

.btn-remove-location {
    background: none;
    color: var(--secondary-color);
    border: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-remove-location:hover {
    background-color: var(--light-color);
    color: var(--dark-color);
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Small Toggle Switch Variant */
.toggle-switch-sm {
    width: 36px;
    height: 20px;
}

.toggle-switch-sm .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch-sm input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Load Summary Grid */
#loadSummaryView {
    animation: fadeIn 0.4s ease;
}

.load-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-card-full {
    grid-column: 1 / -1;
}

.summary-card .card-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.summary-card .card-header h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
}

.summary-card .card-content {
    padding: 1.5rem;
}

.bool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: bold;
}

.bool-icon.true {
    background-color: #d1fae5;
    color: #065f46;
}

.bool-icon.false {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Notes Section */
.notes-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.notes-section .card-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notes-section .card-header h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
}

.notes-list {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.note-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

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

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.note-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-delete-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    transition: all 0.2s;
}

.note-delete-btn:hover {
    background-color: var(--light-color);
    color: var(--danger-color);
}

.note-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.note-content {
    color: var(--dark-color);
    line-height: 1.6;
}

.note-input-container {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-input-container textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.note-input-container button {
    align-self: flex-end;
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Weekly Calendar Styles */
.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 0.5rem;
}

.calendar-week-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    min-width: 250px;
    text-align: center;
}

.btn-calendar-nav {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-calendar-nav:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
}

.btn-calendar-nav svg {
    color: var(--dark-color);
}

.btn-calendar-today {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-calendar-today:hover {
    background: #B7152B;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    min-height: 400px;
    animation: calendarFadeIn 0.3s ease-in-out;
}

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

.calendar-day {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.calendar-day.today {
    border-color: var(--primary-color);
    border-width: 2px;
    background: #fff5f5;
}

.calendar-day.other-month {
    opacity: 0.5;
    background: var(--light-color);
}

.calendar-day-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.calendar-day-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

.calendar-day.today .calendar-day-number {
    color: var(--primary-color);
}

.calendar-day-loads {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.calendar-load-item {
    background: var(--light-color);
    border-left: 3px solid var(--primary-color);
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-load-item:hover {
    background: #e5e7eb;
}

.calendar-load-container {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.125rem;
}

.calendar-load-type {
    font-size: 0.7rem;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.calendar-load-item.appointment {
    border-left-color: #3b82f6;
}

.calendar-load-item.turnin {
    border-left-color: #10b981;
}

.calendar-load-item.lfd {
    border-left-color: #f59e0b;
}

.calendar-load-item.cutoff {
    border-left-color: #ef4444;
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .calendar-day {
        min-height: auto;
    }

    .calendar-day-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .calendar-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .calendar-week-label {
        min-width: 100%;
        order: -1;
    }

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

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .load-summary-grid {
        grid-template-columns: 1fr;
    }

    .modal-wide {
        max-width: 95vw;
        width: 100%;
    }
}

/* Collapsible Customer Rows */
.customer-row-expandable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.customer-row-expandable:hover {
    background-color: rgba(229, 35, 61, 0.02);
}

.expand-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: var(--secondary-color);
    user-select: none;
}

.customer-row-expandable.expanded .expand-icon {
    transform: rotate(90deg);
    color: var(--primary-color);
}

.contacts-row {
    background-color: var(--light-color);
}

.contacts-row td {
    padding: 0 !important;
    border: none !important;
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease, padding 0.3s ease;
}

.contacts-row.visible td {
    height: auto;
    padding: 0 !important;
}

.contacts-container {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 1.5rem;
    transform: translateY(-10px);
    transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease, padding 0.3s ease;
}

.contacts-row.visible .contacts-container {
    max-height: 2000px;
    opacity: 1;
    padding: 1rem 1.5rem;
    transform: translateY(0);
}

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.contacts-header h4 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1rem;
}

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-item {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInContact 0.3s ease forwards;
    opacity: 0;
    transform: translateX(-10px);
}

@keyframes slideInContact {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.contact-item:nth-child(1) {
    animation-delay: 0.05s;
}

.contact-item:nth-child(2) {
    animation-delay: 0.1s;
}

.contact-item:nth-child(3) {
    animation-delay: 0.15s;
}

.contact-item:nth-child(4) {
    animation-delay: 0.2s;
}

.contact-item:nth-child(5) {
    animation-delay: 0.25s;
}

.contact-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(0);
    transition: box-shadow 0.2s ease;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.contact-details {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.contact-details span {
    display: inline-block;
    margin-right: 1rem;
}

.contact-actions {
    display: flex;
    gap: 0.5rem;
}

.contact-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--secondary-color);
    animation: fadeIn 0.4s ease;
}

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

.contact-empty p {
    margin-bottom: 0.5rem;
}

.btn-add-contact {
    background: white;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-add-contact:hover {
    background-color: var(--light-color);
    border-color: var(--secondary-color);
    color: var(--dark-color);
}

.text-danger {
    color: var(--danger-color);
}

/* Google Places Autocomplete Dropdown */
.pac-container {
    z-index: 10001 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Location Address Display */
.location-address-display {
    display: block;
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
    font-style: italic;
}
/* Standard Rates Page */
.standard-rates-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .standard-rates-content {
        grid-template-columns: 1fr;
    }
}

.rate-bands-section {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.rate-chart-section {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.rate-chart-section h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    color: var(--dark-color);
}

.rate-chart-section canvas {
    max-height: 400px;
}

.rate-band-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.rate-band-info label {
    font-weight: 600;
    color: var(--secondary-color);
}

.rate-band-info span {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* Terminal Revenue Report */
.report-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.filter-group input[type="date"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #F9FAFB;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.filter-group button {
    margin-top: auto;
}

#revenueChart {
    max-height: 400px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .report-filters {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions button {
        width: 100%;
    }
}
