/* ============================================================
   FIXED & OPTIMIZED CSS
   ============================================================ */

* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: #f0f4fb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass-hero {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 30px 60px -20px rgba(0, 20, 40, 0.2);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 26px -8px rgba(0, 32, 64, 0.06);
    transition: all 0.25s ease;
}

.glass-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 40px -12px rgba(37, 99, 235, 0.15);
}

.chat-toggle {
    position: fixed;
    bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    right: calc(1.5rem + env(safe-area-inset-right, 0px));
    width: 68px;
    height: 68px;
    -webkit-appearance: none;
    appearance: none;
    isolation: isolate;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 50%;
    background: linear-gradient(145deg, #9db1db, #ffffff);
    color: white;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 14px 28px -6px rgba(37, 99, 235, 0.4);
    border: none;
    transition: all 0.2s ease;
    z-index: 2147483647 !important;
}

.chat-toggle:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 18px 34px -8px #2563eb60;
}

.hero-bg {
    background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.04) 0%, transparent 50%);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e3a6f, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #2563eb;
    flex-shrink: 0;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.6s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}
.delay-2 {
    animation-delay: 0.2s;
}
.delay-3 {
    animation-delay: 0.3s;
}
.delay-4 {
    animation-delay: 0.4s;
}

/* ============================================================
   CHAT WIDGET - MAIN
   ============================================================ */

.chat-widget {
    position: fixed;
    right: calc(1.5rem + env(safe-area-inset-right, 0px));
    bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
    width: 720px;
    max-width: calc(100vw - 2rem);
    height: 700px;
    max-height: calc(100vh - 8rem);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    box-shadow: 0 30px 70px -20px rgba(0, 20, 40, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: none;
    overflow: hidden;
    z-index: 2147483646 !important;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.chat-widget.active {
    display: flex;
}

.chat-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100%;
    width: 100%;
    background: transparent;
    transition: grid-template-columns 0.3s ease;
    min-height: 0;
}

.chat-grid.left-collapsed {
    grid-template-columns: 0px 1fr;
}

/* ============================================================
   LEFT PANEL
   ============================================================ */

.left-panel {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    min-height: 0;
}

.left-collapsed .left-panel {
    padding: 0;
    border-right: none;
    opacity: 0;
    pointer-events: none;
    width: 0;
}

.left-panel .logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0b2b5c;
    padding: 0 0.6rem 1rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.left-panel .logo i {
    color: #2563eb;
    font-size: 1.2rem;
}

.search-box {
    margin: 0.8rem 0;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background 0.15s;
}

.search-box:hover {
    background: rgba(255, 255, 255, 0.85);
}

.search-box i {
    color: #94a3b8;
    font-size: 0.7rem;
}

.nav-section {
    margin-top: 0.8rem;
}

.nav-section .label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.6rem;
}

.nav-item {
    padding: 0.4rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, transform 0.15s;
    cursor: default;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.55);
    transform: translateX(2px);
}

.nav-item i {
    color: #64748b;
    width: 16px;
    font-size: 0.8rem;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.15);
    color: #2563eb;
    font-weight: 500;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.nav-item.active i {
    color: #2563eb;
}

.badge-count {
    margin-left: auto;
    background: rgba(37, 99, 235, 0.12);
    padding: 0 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    color: #2563eb;
    font-weight: 600;
}

.nav-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    margin: 0.6rem 0;
}
/* ============================================================
   Active Booking
   ============================================================ */

/* ============================================================
   BOOKING LIST / BOOKING GRID (used by JS renderBookingList)
   ============================================================ */

.booking-list {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    margin: 6px 0;
    border: 1px solid #e2e8f0;
    width: 100%;
    max-height: 230px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.booking-list .no-bookings {
    color: #64748b;
    font-size: 0.8rem;
    padding: 20px 0;
    text-align: center;
}

.booking-status-group {
    margin-bottom: 12px;
}

.booking-status-group:last-child {
    margin-bottom: 0;
}

.booking-status-header {
    font-weight: 600;
    color: var(--status-color, #64748b);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.booking-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.booking-card {
    background: white;
    border-radius: 6px;
    padding: 4px 6px;
    border: 1px solid #e8edf4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
    cursor: default;
    display: flex;
    flex-direction: column;
    min-width: 120px;
    gap: 2px;
}

.booking-card:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

@media (hover: none) {
    .booking-card:hover {
        border-color: #e8edf4;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }
}

.booking-card .bc-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-card .bc-date {
    color: #64748b;
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-card .bc-tags {
    display: flex;
    gap: 4px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.booking-card .bc-tag {
    background: #f1f5f9;
    padding: 0 6px;
    border-radius: 3px;
    font-size: 0.5rem;
    color: #475569;
}

.booking-card .bc-status {
    margin-top: 4px;
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--status-color, #64748b);
    background: color-mix(in srgb, var(--status-color, #64748b) 15%, transparent);
    padding: 1px 6px;
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
}


/* ============================================================
   MIDDLE PANEL
   ============================================================ */

.middle-panel {
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 280px;
    min-height: 0;
}

.middle-header {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
    gap: 6px;
}

.middle-header .toggle-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 8px;
    transition: all 0.15s;
}

.mobile-close-btn {
    display: none;
}

.middle-header .toggle-btn:hover {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.25);
}

.middle-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.85rem;
    color: #0b2b5c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}

.middle-title i {
    color: #2563eb;
}

/* ============================================================
   MESSAGE LIST
   ============================================================ */

.message-list {
    flex: 0 0 auto;
    max-height: 100px;
    overflow-y: auto;
    overflow: hidden;
    padding: 0.3rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.25);
    transition: max-height 0.35s ease;
}

.message-list.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.msg-item {
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
    margin-bottom: 0.1rem;
    transition: background 0.15s;
    cursor: default;
}

.msg-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

.msg-item .title {
    font-weight: 600;
    font-size: 0.75rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg-item .title i {
    color: #2563eb;
    font-size: 0.65rem;
}

.msg-item .preview {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-item .time {
    font-size: 0.55rem;
    color: #94a3b8;
    margin-left: auto;
}

.msg-item .meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   CHAT STREAM
   ============================================================ */

.chat-stream {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.6rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: transparent;
}

/* ============================================================
   CHAT BUBBLES
   ============================================================ */

.chat-bubble {
    padding: 0.65rem 0.95rem;
    border-radius: 16px;
    max-width: 75%;
    font-size: 0.8rem;
    line-height: 1.5;
    animation: slideUp 0.2s ease;
    word-break: break-word;
    white-space: normal;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-bubble.bot {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.7);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #0b2b5c;
    box-shadow: 0 4px 16px -6px rgba(0, 32, 64, 0.08);
}

.chat-bubble.user {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(29, 78, 216, 0.9));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px -6px rgba(37, 99, 235, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-bubble .stage-chip {
    display: inline-block;
    background: rgba(37, 99, 235, 0.15);
    color: #1e3a6f;
    border-radius: 12px;
    padding: 0 8px;
    font-size: 0.6rem;
    font-weight: 600;
    margin-bottom: 2px;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

/* ============================================================
   FORM ELEMENTS (inline forms)
   ============================================================ */

.staff-form-inline {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 14px;
    padding: 10px 12px;
    margin-top: 4px;
    align-self: flex-start;
    width: 75%;
    box-shadow: 0 6px 20px -8px rgba(0, 32, 64, 0.1);
}

.staff-form-inline .sf-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.staff-form-inline .sf-field {
    margin-bottom: 6px;
}

.staff-form-inline .sf-field label {
    font-size: 0.55rem;
    color: #64748b;
    display: block;
    margin-bottom: 2px;
}

.staff-form-inline .sf-field input {
    width: 100%;
    padding: 5px 7px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    color: #0f172a;
    font-size: 16px; /* FIXED: prevents iOS zoom */
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    touch-action: manipulation;
}

.staff-form-inline .sf-field input:focus {
    border-color: #2563eb;
}

.staff-form-inline .sf-field .sf-error {
    font-size: 0.55rem;
    color: #ef4444;
    margin-top: 2px;
    display: none;
}

.staff-form-inline .sf-field.invalid input {
    border-color: #ef4444;
}

.staff-form-inline .sf-field.invalid .sf-error {
    display: block;
}

.staff-form-inline .submit-btn {
    width: 100%;
    margin-top: 4px;
    padding: 6px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
}

.staff-form-inline .submit-btn:hover {
    background: #1d4ed8;
}

.staff-form-inline .submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   DATE PICKER
   ============================================================ */

.date-picker-inline {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 14px;
    padding: 10px 12px;
    margin-top: 4px;
    align-self: flex-start;
    width: 75%;
    box-shadow: 0 6px 20px -8px rgba(0, 32, 64, 0.1);
}

.date-picker-inline .dp-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.date-picker-inline .dp-row {
    display: flex;
    gap: 6px;
}

.date-picker-inline .dp-field {
    flex: 1;
}

.date-picker-inline .dp-field label {
    font-size: 0.55rem;
    color: #64748b;
    display: block;
    margin-bottom: 2px;
}

.date-picker-inline .dp-field input[type="date"] {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    color: #b1b9cc;
    font-size: 16px; /* FIXED: prevents iOS zoom */
    font-weight: 400;
    font-family: inherit;
    outline: none;
    touch-action: manipulation;
}

.date-picker-inline .dp-field input[type="date"].has-value {
    color: #2563eb;
    font-weight: 700;
}

.date-picker-inline .dp-field input[type="date"]:focus {
    border-color: #2563eb;
}

.date-picker-inline .search-btn {
    width: 100%;
    margin-top: 6px;
    padding: 5px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s;
}

.date-picker-inline .search-btn:hover {
    background: #1d4ed8;
}

/* ============================================================
   SUMMARY & PAYMENT
   ============================================================ */

.summary-inline {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 12px;
    margin-top: 4px;
    align-self: flex-start;
    width: 75%;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.3);
}

.summary-inline .sh {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.summary-inline .srow {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.summary-inline .srow:last-child {
    border: none;
}

.summary-inline .sk {
    color: rgba(255, 255, 255, .45);
}

.summary-inline .sv {
    font-weight: 600;
    color: #fff;
}

.pay-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: rgba(15, 23, 42, 0.85);
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    align-self: flex-start;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pay-inline:hover {
    background: rgba(29, 78, 216, 0.9);
    transform: translateY(-1px);
}

/* ============================================================
   TYPING INDICATOR
   ============================================================ */

.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0.9rem;
    margin: 0 1rem 0.4rem;
    width: fit-content;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    flex-shrink: 0;
    animation: slideUp 0.2s ease;
}

.typing-indicator.show {
    display: flex;
}

.typing-indicator span:not(.typing-text) {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

.typing-indicator .typing-text {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    margin-left: 2px;
}

@keyframes typingBounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* ============================================================
   ASK BOX - FIXED FOR MOBILE ZOOM
   ============================================================ */

.ask-box {
    padding: 0.6rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ask-box input {
    flex: 1;
    padding: 0.55rem 1rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.65);
    font-size: 16px; /* FIXED: Minimum 16px to prevent iOS zoom */
    outline: none;
    transition: all 0.15s;
    touch-action: manipulation; /* Prevents double-tap zoom */
    -webkit-appearance: none; /* Removes default iOS styling */
    appearance: none;
}

.ask-box input:focus {
    border-color: #2563eb;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Remove default focus ring on some browsers */
.ask-box input::-moz-focus-inner {
    border: 0;
}

/* Focus-visible for keyboard navigation */
.ask-box input:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.ask-box button {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.5);
    flex-shrink: 0;
    touch-action: manipulation;
}

.ask-box button:hover {
    transform: scale(1.08);
}

.ask-box button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   CAR GRID
   ============================================================ */

.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.car-grid::-webkit-scrollbar {
    width: 4px;
}

.car-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.car-grid::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 4px;
}

.car-grid::-webkit-scrollbar-thumb:hover {
    background: #1d4ed8;
}

.car-grid .car-card {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.75);
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.car-grid .car-card:hover,
.car-grid .car-card:focus-visible {
    border-color: #2563eb;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
    outline: none;
}

.car-grid .car-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.car-grid .car-details {
    font-size: 0.55rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 2px 0;
}

.car-grid .car-details span {
    background: rgba(241, 245, 249, 0.9);
    padding: 0 5px;
    border-radius: 4px;
}

.car-grid .book-now {
    margin-top: auto;
    padding: 3px 0;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s;
    width: 100%;
}

.car-grid .book-now:hover {
    background: #1d4ed8;
}

/* ============================================================
   FILTER BAR
   ============================================================ */

 
.car-grid-container {
    position: relative; /* anchors .filter-toggle-btn */
    padding-top: 4px; /* reserve space so the toggle button doesn't overlap grid content */
}
 
.filter-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.7);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    cursor: pointer;
    z-index: 5;
    transition: all 0.15s;
}
 
.filter-toggle-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: rgba(255, 255, 255, 0.95);
}
 
@media (hover: none) {
    .filter-toggle-btn:hover {
        border-color: rgba(255, 255, 255, 0.7);
        color: #64748b;
        background: rgba(255, 255, 255, 0.7);
    }
}
 
.filter-toggle-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}
 
.filter-bar {
    display: none; /* FIX: filter panel is hidden by default now, toggled via .filter-toggle-btn */
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    align-items: center;
}
 
.filter-bar.open {
    display: flex;
}
 
.filter-bar .filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
    background: rgba(255, 255, 255, 0.75);
    padding: 2px 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}
 
.filter-bar .filter-group-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: #94a3b8;
    margin-right: 2px;
    padding: 0 2px;
}
 
.filter-bar .filter-btn {
    padding: 1px 8px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.55rem;
    cursor: pointer;
    transition: all 0.12s;
    font-weight: 400;
}
 
.filter-bar .filter-btn:hover {
    background: rgba(238, 242, 246, 0.9);
    color: #1e293b;
}
 
.filter-bar .filter-btn.active {
    background: #2563eb;
    color: white;
    font-weight: 600;
}
 
.filter-bar .clear-filters {
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.7);
    color: #64748b;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.12s;
    font-weight: 500;
}
 
.filter-bar .clear-filters:hover {
    border-color: #ef4444;
    color: #ef4444;
}
 
.filter-bar .result-count {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-left: auto;
}
 
.no-results {
    padding: 12px;
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    margin: 8px 0;
}
 
.grid-header {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 4px;
    margin-top: 4px;
}
 
.grid-header:first-of-type {
    margin-top: 0;
}

/* ============================================================
   SUGGESTION CONTAINER
   ============================================================ */

.suggestion-container {
    position: absolute;
    bottom: 70px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    pointer-events: none;
    z-index: 10;
    max-width: 220px;
}

.suggestion-container .suggestion-item {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 6px 14px 6px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #0b2b5c;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    max-width: 100%;
    animation: chipIn 0.18s ease;
}

.suggestion-container .suggestion-item:hover {
    transform: translateY(-2px) scale(1.03);
    background: #ffffff;
    box-shadow: 0 12px 28px -8px rgba(37, 99, 235, 0.2);
    border-color: #2563eb;
}

.suggestion-container .suggestion-item i {
    color: #2563eb;
    font-size: 0.65rem;
    width: 16px;
}

.suggestion-container .suggestion-item.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border-color: #2563eb;
    box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.3);
}

.suggestion-container .suggestion-item.primary i {
    color: white;
}

.suggestion-container .suggestion-item.primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 12px 28px -8px rgba(37, 99, 235, 0.4);
}

.suggestion-container .suggestion-item.confirm {
    background: linear-gradient(135deg, #12b34f, #0ea34a);
    color: white;
    border-color: #12b34f;
    box-shadow: 0 8px 20px -6px rgba(49, 211, 89, 0.3);
}

.suggestion-container .suggestion-item.confirm i {
    color: #ffffff;
    font-size: 0.65rem;
    width: 16px;
}

@keyframes chipIn {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
    .chat-widget {
        right: calc(1rem + env(safe-area-inset-right, 0px));
        bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
        width: min(600px, calc(100vw - 2rem));
        height: min(680px, calc(100vh - 8.5rem));
    }
    .chat-grid {
        grid-template-columns: 200px 1fr;
    }
}

/* Mobile */
@media (max-width: 720px) {
    .chat-widget {
        right: calc(0.8rem + env(safe-area-inset-right, 0px));
        bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
        width: calc(100vw - 1.6rem);
        height: 75vh;
        height: 75dvh;
        max-height: calc(100vh - 8rem);
        max-height: calc(100dvh - 8rem);
        border-radius: 24px;
    }

    .chat-grid,
    .chat-grid.left-collapsed {
        grid-template-columns: 1fr;
    }

    .left-panel {
        display: none;
    }

    .middle-header .toggle-btn {
        display: none;
    }

    .middle-panel {
        min-width: 0;
    }

    .car-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .chat-bubble {
        max-width: 70%;
    }

    .staff-form-inline,
    .date-picker-inline,
    .summary-inline {
        width: 50%;
    }

    .suggestion-container {
        bottom: 65px;
        right: 10px;
        max-width: 180px;
        gap: 6px;
    }

    .suggestion-container .suggestion-item {
        font-size: 0.6rem;
        padding: 4px 10px 4px 8px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .chat-widget {
        right: calc(0.5rem + env(safe-area-inset-right, 0px));
        left: calc(0.5rem + env(safe-area-inset-left, 0px));
        bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: none;
        height: 78vh;
        height: 78dvh;
        max-height: calc(100vh - 7rem);
        max-height: calc(100dvh - 7rem);
        border-radius: 20px;
    }

    .middle-title {
        font-size: 0.8rem;
    }

    .message-list {
        max-height: 76px;
    }

    .chat-stream {
        padding: 0.5rem 0.75rem;
    }

    .chat-bubble {
        max-width: 70%;
        font-size: 0.75rem;
        padding: 0.55rem 0.8rem;
        max-height: 450px;
    }

    .filter-bar .filter-group {
        padding: 1px 3px;
    }

    .ask-box {
        padding: 0.5rem 0.8rem;
    }
    .booking-grid{
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ask-box input {
        font-size: 16px; /* Ensure minimum font size on mobile */
    }

    .staff-form-inline,
    .date-picker-inline{
        width: 100%;
    }
    .summary-inline {
        width: 50%;
    }

    .car-grid {
        max-height: 100px;
    }

    /* Stack pickup/drop-off fields on narrow screens */
    .date-picker-inline .dp-row {
        flex-direction: column;
        gap: 8px;
    }

    .suggestion-container {
        max-width: calc(100vw - 2.5rem);
    }

    .chat-toggle {
        width: 58px;
        height: 58px;
        font-size: 26px;
        bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
        right: calc(1.2rem + env(safe-area-inset-right, 0px));
    }

    .stat-number {
        font-size: 1.6rem;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .chat-toggle {
        width: 52px;
        height: 52px;
        font-size: 22px;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        right: calc(1rem + env(safe-area-inset-right, 0px));
    }

    .chat-widget {
        bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 720px) {
    .chat-widget.active {
        position: fixed;
        inset: 0;
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-sizing: border-box;
    }

    body.chat-open .chat-toggle {
        display: none;
    }

    .chat-widget.active .middle-header {
        padding-top: calc(0.4rem + env(safe-area-inset-top, 0px));
    }

    .chat-widget.active .mobile-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}