/* ===================================================
   MyApp Modern Design System (2026 SaaS Dashboard Style)
   =================================================== */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-border: #c7d2fe;
    
    --sidebar-bg: #0f172a;
    --sidebar-surface: #1e293b;
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #f8fafc;
    --sidebar-active-bg: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #818cf8;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #06b6d4;
    --info-light: #cffafe;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
    --shadow-glow: 0 0 20px -3px rgba(79, 70, 229, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Plus Jakarta Sans', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-main);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===================================================
   Initial Preloader Screen
   =================================================== */
.initial-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #0f172a;
    color: white;
}

.loader-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 24px;
}

.loader-logo .logo-circle {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: #1e293b;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.loader-bar-fill {
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #06b6d4);
    border-radius: 999px;
    animation: loaderSlide 1.2s infinite ease-in-out;
}

.loader-text {
    margin-top: 14px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

@keyframes loaderSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

/* ===================================================
   Toast System (Floating Modern Notifications)
   =================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 320px;
    max-width: 440px;
}

.toast-item .toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon { background: var(--success-light); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-light); color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast-info .toast-icon { background: var(--info-light); color: var(--info); }

.toast-content {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.84rem;
    line-height: 1.4;
    color: #475569;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}
.toast-close:hover {
    color: var(--text-main);
    background: var(--surface-hover);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* ===================================================
   Modern Card & Containers
   =================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    border-color: #cbd5e1;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 24px;
}

/* ===================================================
   Form Controls
   =================================================== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.validation-message {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===================================================
   Buttons
   =================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-danger {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--primary-border);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.btn-outline-danger {
    background: transparent;
    border-color: #fca5a5;
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger-light);
    border-color: var(--danger);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-w-full {
    width: 100%;
}

/* ===================================================
   Tables
   =================================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: white;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.table th {
    background: #f8fafc;
    padding: 9px 14px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.paged-table th,
.paged-table thead th {
    text-align: center !important;
    font-weight: 700 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    padding: 9px 14px !important;
}

.table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    vertical-align: middle;
    white-space: nowrap;
}

.paged-table td {
    padding: 8px 14px !important;
}

/* ข้อความบรรทัดเดียว ถ้าไม่มี \n และยาวเกินขอบเขต ให้ตัดจบด้วย ... (Ellipsis) พร้อม Tooltip เมื่อ Hover */
.text-ellipsis {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block;
    vertical-align: middle;
    cursor: default;
    position: relative;
}

/* Custom SaaS Floating Tooltip สำหรับเซลล์ข้อความ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    max-width: 280px;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #0f172a;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 4px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Helper Class สำหรับตัวเลขและทศนิยม */
.text-numeric {
    text-align: right !important;
    font-family: var(--bs-font-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-variant-numeric: tabular-nums;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-success { background: var(--success-light); color: #047857; border: 1px solid #a7f3d0; }
.badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-info { background: #cffafe; color: #0e7490; border: 1px solid #a5f3fc; }
.badge-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* ===================================================
   Pagination
   =================================================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.page-link:hover {
    background: var(--surface-hover);
    border-color: #cbd5e1;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===================================================
   Modal System
   =================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.modal-dialog {
    background: transparent;
    width: 100%;
    max-width: 500px;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.modal-sm { max-width: 380px !important; }
.modal-dialog.modal-lg { max-width: 850px !important; }
.modal-dialog.modal-xl { max-width: 1180px !important; }
.modal-dialog.modal-fullscreen { max-width: 100vw !important; width: 100vw !important; height: 100vh !important; margin: 0 !important; }

@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h5 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}

/* ===================================================
   Utilities
   =================================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 24px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 24px; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-1\.5, .gap-1-5 { gap: 6px; }
.gap-2 { gap: 8px; }
.gap-2\.5, .gap-2-5 { gap: 10px; }
.gap-3 { gap: 14px; }
.p-2\.5, .p-2-5 { padding: 10px; }
.px-2\.5, .px-2-5 { padding-left: 10px; padding-right: 10px; }
.px-3\.5, .px-3-5 { padding-left: 14px; padding-right: 14px; }
.py-0\.5, .py-0-5 { padding-top: 2px; padding-bottom: 2px; }
.px-1\.5, .px-1-5 { padding-left: 6px; padding-right: 6px; }
.mb-1\.5, .mb-1-5 { margin-bottom: 6px; }
.mt-0\.5, .mt-0-5 { margin-top: 2px; }
.me-0\.5, .me-0-5 { margin-right: 2px; }
.ms-0\.5, .ms-0-5 { margin-left: 2px; }
.w-100 { width: 100%; }

/* ===================================================
   Blazor Error UI (Hidden by default, displayed only on unhandled error)
   =================================================== */
#blazor-error-ui {
    background: #fee2e2;
    color: #991b1b;
    border-top: 2px solid #ef4444;
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: 12px 24px;
    position: fixed;
    width: 100%;
    z-index: 100000;
    font-size: 0.88rem;
    font-weight: 600;
    align-items: center;
    justify-content: space-between;
}

#blazor-error-ui .reload {
    color: #4338ca;
    text-decoration: underline;
    margin-left: 8px;
    font-weight: 700;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: auto;
    color: #991b1b;
    padding: 2px 8px;
}

/* ===================================================
   Global Sidebar & Navigation Link Overrides
   =================================================== */
.sidebar-nav a,
.sidebar a {
    color: #94a3b8 !important;
    text-decoration: none !important;
}

.sidebar-nav a:visited {
    color: #94a3b8 !important;
}

.sidebar-nav a:hover {
    color: #ffffff !important;
}

.sidebar-nav a.active,
.sidebar-nav a.active:visited {
    color: #ffffff !important;
}

/* ===================================================
   Page Titles & Modern Data Table Polish
   =================================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.search-box-wrapper {
    position: relative;
    max-width: 420px;
    margin-bottom: 20px;
}

.search-box-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.95rem;
}

.search-box-wrapper .form-control {
    padding-left: 42px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* ===================================================
   Main Layout Structure
   =================================================== */
.app-layout {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background-color: var(--bg);
}

.main-content {
    flex: 1;
    margin-left: 260px; /* เว้นที่ให้ Sidebar กว้าง 260px */
    min-width: 0;       /* ป้องกัน Flexbox Child ดันจอจนล้น */
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.page-content {
    padding: 24px 32px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Sortable Table Header */
.sortable-header {
    transition: background-color 0.15s ease, color 0.15s ease;
}
.sortable-header:hover {
    background-color: #f1f5f9 !important;
}
.sortable-header:hover .sort-neutral-icon {
    opacity: 0.65 !important;
}
.sort-priority-badge {
    font-size: 0.65rem !important;
    padding: 2px 5px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
}

/* ===================================================
   Leaflet Map Teardrop Pin Markers (ทรงเข็มหมุดหยดน้ำ)
   =================================================== */
.dom-leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.dom-pin-marker {
    position: relative;
    width: 36px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.dom-pin-marker:hover {
    transform: scale(1.18) translateY(-4px);
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
    z-index: 9999 !important;
}

.dom-pin-body {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid #ffffff;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.dom-pin-text {
    color: #ffffff;
    font-weight: 800;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.dom-pin-tip {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 13px solid #0d6efd;
    margin-top: -3px;
}

/* Multi Orders at Same Location Pin */
.dom-multi-pin-marker {
    width: 42px;
    height: 54px;
}

.dom-multi-pin-body {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: 2.5px solid #ffffff;
    flex-direction: column;
    justify-content: center;
    gap: 0px;
}

.dom-multi-pin-tip {
    border-left-width: 9px;
    border-right-width: 9px;
    border-top-width: 14px;
    border-top-color: #d97706 !important;
}

.dom-multi-count {
    color: #ffffff;
    font-weight: 900;
    font-size: 15px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.dom-multi-label {
    color: #fef3c7;
    font-weight: 700;
    font-size: 9px;
    line-height: 1;
    margin-top: 1px;
}

/* Hub / Depot Pin styling */
.dom-hub-pin {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0f172a;
    border: 2.5px solid #facc15;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.dom-hub-pin:hover {
    transform: scale(1.15);
}

.dom-hub-order-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 10px;
    padding: 1px 5px;
    border: 1.5px solid #ffffff;
}

/* Bounce effect when focused from table */
.dom-marker-bounce {
    animation: domPinBounce 0.8s ease;
}

@keyframes domPinBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-16px); }
    60% { transform: translateY(-8px); }
}

/* ===================================================
   Delivery Requirements Palette Standard (ADR-0019)
   Primary & Amber: Solid / Vibrant Style
   =================================================== */
.badge-req-delivery {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
    border: none !important;
}

.badge-req-pickup {
    background-color: #d97706 !important;
    color: #ffffff !important;
    border: none !important;
}

.badge-req-both {
    background-color: #7e22ce !important;
    color: #ffffff !important;
    border: none !important;
}

/* Form switch label text colors */
.text-req-delivery {
    color: #4f46e5 !important;
}

.text-req-pickup {
    color: #d97706 !important;
}

.text-req-both {
    color: #7e22ce !important;
}

/* Zone Destination Pin Marker Styles */
.dom-zone-dest-pin {
    width: 44px;
    height: 52px;
}

.dom-zone-dest-pin .dom-pin-body {
    width: 44px;
    height: 38px;
    border-radius: 20px;
    padding: 0 4px;
}

.dom-zone-dest-pin .dom-pin-text {
    font-size: 11px;
    font-weight: 800;
    max-width: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.dom-zone-dest-pin .dom-zone-dest-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #2563eb;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    border-radius: 10px;
    padding: 1px 4.5px;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

/* Route Planner Marker Focus & Dim (ADR-0039) */
.dom-marker-highlight {
    opacity: 1 !important;
    filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.75));
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.dom-marker-dimmed {
    opacity: 0.22 !important;
    filter: grayscale(80%);
    transition: opacity 0.25s ease, filter 0.25s ease;
}

/* Cargo Photo Action Button Style */
.btn-outline-chat {
    color: #0284c7;
    border: 1px solid #0284c7;
    background-color: transparent;
    transition: all 0.15s ease-in-out;
}
.btn-outline-chat:hover,
.btn-outline-chat:focus {
    color: #ffffff;
    background-color: #0284c7;
    border-color: #0284c7;
}

.btn-outline-cargo {
    color: #0284c7;
    border: 1px solid #0ea5e9;
    background-color: transparent;
    transition: all 0.15s ease-in-out;
}
.btn-outline-cargo:hover,
.btn-outline-cargo:focus {
    color: #ffffff;
    background-color: #0284c7;
    border-color: #0284c7;
}
.btn-outline-cargo .cargo-count-badge {
    background-color: #0369a1;
    color: #ffffff;
    font-weight: 700;
    transition: all 0.15s ease-in-out;
}
.btn-outline-cargo:hover .cargo-count-badge {
    background-color: #ffffff !important;
    color: #0369a1 !important;
}

.btn-outline-primary .item-count-badge {
    background-color: #1d4ed8;
    color: #ffffff;
    font-weight: 700;
    transition: all 0.15s ease-in-out;
}
.btn-outline-primary:hover .item-count-badge {
    background-color: #ffffff !important;
    color: #1d4ed8 !important;
}

/* ===================================================
   Tab 3 Trips & Tracking Redesign (Responsive & Timeline)
   =================================================== */

/* Horizontal Filter Chips */
.tab3-filter-chips {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    min-height: 30px;
}
.tab3-filter-chips::-webkit-scrollbar {
    display: none;
}

.tab3-chip {
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    padding: 0.22rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    line-height: 1.2;
    flex-shrink: 0;
}
.tab3-chip:hover {
    filter: brightness(0.95);
}

/* Route Timeline Component */
.stop-timeline {
    position: relative;
    padding: 0.25rem 0.15rem;
}

.stop-timeline-item {
    position: relative;
    display: flex;
    gap: 0.65rem;
    padding-bottom: 0.65rem;
}
.stop-timeline-item:last-child {
    padding-bottom: 0;
}

/* Timeline left track */
.stop-timeline-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
    flex-shrink: 0;
    position: relative;
}

.stop-timeline-node {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    z-index: 2;
    background-color: #f1f5f9;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    transition: transform 0.15s ease;
}

.stop-timeline-item:hover .stop-timeline-node {
    transform: scale(1.15);
}

.stop-timeline-line {
    position: absolute;
    top: 22px;
    bottom: -4px;
    width: 2px;
    background-color: #e2e8f0;
    z-index: 1;
}

.stop-timeline-item:last-child .stop-timeline-line {
    display: none;
}

/* Timeline card content */
.stop-timeline-content {
    flex-grow: 1;
    min-width: 0;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.stop-timeline-content:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stop-timeline-content.is-active-stop {
    border-color: #3b82f6;
    background-color: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.stop-timeline-content.is-failed-stop {
    border-color: #fca5a5;
    background-color: #fef2f2;
}

.stop-timeline-content.is-rejected-stop {
    border-color: #fed7aa;
    background-color: #fffaf0;
}

.stop-timeline-content.is-rejected-stop:hover {
    border-color: #fdba74;
    background-color: #fff7ed;
}

.stop-timeline-content.is-depot-stop {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

/* Rejection Badge Standard (Orange #fd7e14 matching Mas_tripstop_status) */
.badge-rejected {
    background-color: #fd7e14 !important;
    color: #ffffff !important;
}

/* Spacing and Fractional Utilities */
.gap-1\.5 { gap: 0.375rem !important; }
.p-2\.5 { padding: 0.625rem !important; }
.px-2\.5 { padding-left: 0.625rem !important; padding-right: 0.625rem !important; }
.py-2\.5 { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.ms-1\.5 { margin-left: 0.375rem !important; }
.me-1\.5 { margin-right: 0.375rem !important; }
.mb-1\.5 { margin-bottom: 0.375rem !important; }
.mt-1\.5 { margin-top: 0.375rem !important; }

