/* ================================================================
   ZimLink Driver Portal — driver.css
   Layout strategy:
     - Gate/auth screens: full-viewport, properly centered, card-based
     - Chat list/room: constrained 620px column centered on screen
     - Topbar: full-width dark bar, content inside mirrors app width
   Brand: ZimLink green rgb(37,189,37) | white | near-black #060618
   Font: Inter throughout
   ================================================================ */

/* ── TOKENS ──────────────────────────────────────────────────── */
:root {
    --green:       rgb(37, 189, 37);
    --green-dark:  rgb(3, 152, 3);
    --green-mid:   rgb(30, 160, 30);
    --green-soft:  rgba(37, 189, 37, 0.08);
    --green-pale:  rgba(37, 189, 37, 0.04);
    --green-glow:  rgba(37, 189, 37, 0.22);
    --green-route: rgb(22, 140, 22);

    --dark:        #060618;
    --dark2:       #0f0f2a;
    --white:       #ffffff;
    --bg:          #f3f7f3;
    --card:        #ffffff;
    --border:      #d8e8d8;
    --text:        #111827;
    --muted:       #6b7c6b;
    --danger:      #dc2626;

    /* chat surfaces */
    --surface:     #f4f7f4;
    --surface2:    #eef2ee;
    --bubble-me:   rgb(37, 189, 37);
    --bubble-them: #eef2ee;
    --bubble-driver: rgba(37, 189, 37, 0.10);

    --radius:      10px;
    --shadow:      0 1px 4px rgba(0,0,0,0.08);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   TOP BAR — full width, green-accented dark bar
   ================================================================ */
.driver-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--green);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
}

.driver-topbar-inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.driver-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    color: white;
    letter-spacing: -0.02em;
}

.driver-topbar-brand svg { color: white; flex-shrink: 0; }

.driver-topbar-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--green);
    background: white;
    border: none;
    border-radius: 20px;
    padding: 2px 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-left: 4px;
}

.driver-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-topbar-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.driver-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: white;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s;
}
.driver-logout-btn:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.55);
}

/* ================================================================
   PAGE WRAPPER — centers everything below the topbar
   ================================================================ */
.driver-page {
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ================================================================
   GATE VIEW — "Become a Driver" landing screen
   ================================================================ */
.driver-gate-view {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    min-height: calc(100vh - 56px);
    width: 100%;
    gap: 20px;
}
.driver-gate-view.active { display: flex; }

.driver-gate-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--green-soft);
    border: 2px solid var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    margin-bottom: 8px;
}

.driver-gate-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.driver-gate-sub {
    font-size: 15px;
    color: var(--muted);
    max-width: 340px;
    line-height: 1.65;
}

.driver-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin-top: 12px;
}

.driver-gate-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all .15s;
    letter-spacing: -0.01em;
}
.driver-gate-btn.primary {
    background: var(--green);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(37,189,37,0.35);
}
.driver-gate-btn.primary:hover { background: var(--green-mid); }
.driver-gate-btn.secondary {
    background: white;
    color: var(--green);
    border: 1.5px solid var(--green);
}
.driver-gate-btn.secondary:hover { background: var(--green-soft); }

/* ================================================================
   FORM VIEWS — register / login (shared card layout)
   ================================================================ */
.driver-form-view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: calc(100vh - 56px);
    padding: 40px 16px 60px;
}
.driver-form-view.active { display: flex; }

.driver-form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

.driver-form-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.driver-form-back-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    flex-shrink: 0;
    transition: all .15s;
}
.driver-form-back-btn:hover { border-color: var(--green); color: var(--green); }

.driver-form-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.driver-form-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.5;
}

.driver-form-body {
    padding: 24px;
}

.driver-field { margin-bottom: 16px; }
.driver-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}
.driver-field input,
.driver-field select,
.driver-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: white;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
    -webkit-appearance: none;
}
.driver-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7c6b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.driver-field input:focus,
.driver-field select:focus,
.driver-field textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-soft);
}
.driver-field textarea { resize: vertical; min-height: 76px; line-height: 1.5; }

.driver-form-error-banner {
    display: none;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: var(--danger);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}
.driver-form-error-banner.show { display: block; }

.driver-submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background .15s;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 8px rgba(37,189,37,0.3);
}
.driver-submit-btn:hover { background: var(--green-mid); }
.driver-submit-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.driver-form-footer-link {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
}
.driver-form-footer-link button {
    background: none;
    border: none;
    color: var(--green);
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
    font-family: 'Inter', sans-serif;
}

/* ================================================================
   APPLICATION SUBMITTED VIEW
   ================================================================ */
.driver-pending-view {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    min-height: calc(100vh - 56px);
    width: 100%;
    gap: 18px;
}
.driver-pending-view.active { display: flex; }

.driver-pending-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--green-soft);
    border: 2px solid var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
}
.driver-pending-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.driver-pending-sub {
    font-size: 14px;
    color: var(--muted);
    max-width: 340px;
    line-height: 1.65;
}

/* ================================================================
   CHAT APP WRAPPER — constrained column for list + room
   ================================================================ */
.driver-chat-wrap {
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 620px;
    min-height: calc(100vh - 56px);
    background: var(--card);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    margin: 0 auto;
}
.driver-chat-wrap.active { display: flex; }

/* ================================================================
   CHAT LIST VIEW
   ================================================================ */
.chat-list-view {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.chat-list-header {
    padding: 22px 20px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.chat-list-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}
.chat-list-title svg { color: var(--green); }

.chat-list-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    gap: 14px;
    text-align: center;
    flex: 1;
}
.chat-empty-state svg { color: var(--muted); opacity: .5; }
.chat-empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); }
.chat-empty-state p {
    color: var(--muted);
    font-size: 14px;
    max-width: 280px;
    line-height: 1.65;
}

.chat-list { flex: 1; }

.chat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .12s;
    position: relative;
}
.chat-item:hover { background: var(--green-pale); }

.chat-item-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--green-soft);
    border: 2px solid var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: var(--green-dark);
    flex-shrink: 0;
}
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-item-preview {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}
.chat-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.chat-item-time { font-size: 11px; color: var(--muted); }

.chat-item-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.cstatus-active    { background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--green-glow); }
.cstatus-packaging { background: rgba(255,165,0,0.12); color: #b45309; border: 1px solid rgba(255,165,0,0.25); }
.cstatus-dispatched{ background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--green-glow); }
.cstatus-delivered { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ================================================================
   CHAT ROOM VIEW
   ================================================================ */
.chat-room-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: calc(100vh - 56px);
}

.chat-room-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    transition: all .15s;
    flex-shrink: 0;
}
.back-btn:hover { border-color: var(--green); color: var(--green); }

.chat-room-info { flex: 1; min-width: 0; }
.chat-room-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.chat-room-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rename-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 2px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.rename-chat-btn:hover { color: var(--green); }
.chat-room-members {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-room-header-actions { display: flex; gap: 8px; }
.header-action-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    padding: 7px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all .15s;
}
.header-action-btn:hover { border-color: var(--green); color: var(--green); }

/* ── MAP ────────────────────────────────────────────────────── */
.pinned-map-container {
    flex-shrink: 0;
    height: 190px;
    background: var(--surface2);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    transition: height .3s ease;
    position: relative;
}
.pinned-map-container.collapsed { height: 0; border: none; }
#chatMap { width: 100%; height: 100%; }

.map-live-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(6,6,24,0.85);
    border: 1px solid var(--green);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1000;
    letter-spacing: 0.05em;
}
.live-dot {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.map-participants-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(6,6,24,0.88);
    padding: 6px 14px;
    display: flex;
    gap: 20px;
    z-index: 1000;
}
.map-part {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}
.part-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── STATUS BAR ─────────────────────────────────────────────── */
.delivery-status-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    flex-shrink: 0;
}
.status-steps {
    display: flex;
    align-items: center;
}
.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.status-step span {
    font-size: 9px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.status-step.active span { color: var(--green); }
.status-step.done span   { color: var(--green-dark); opacity: .7; }

.sstep-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all .25s;
}
.status-step.active .sstep-dot {
    background: var(--green);
    border-color: var(--green);
    color: white;
    box-shadow: 0 0 0 4px var(--green-soft);
}
.status-step.done .sstep-dot {
    background: var(--green-soft);
    border-color: var(--green-glow);
    color: var(--green-dark);
}
.status-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 14px;
    transition: background .25s;
}
.status-line.done { background: var(--green-glow); }

.driver-status-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.status-ctrl-label { font-size: 11px; color: var(--muted); }
.sstatus-btn {
    background: transparent;
    border: 1px solid var(--green);
    color: var(--green);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.sstatus-btn:hover { background: var(--green); color: white; }

/* ── MESSAGES ───────────────────────────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
    background: white;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.msg-date-divider {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding: 8px 0;
}
.msg-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    align-items: flex-end;
}
.msg-row.me { flex-direction: row-reverse; }

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
}
.msg-avatar.driver-avatar { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.msg-avatar.seller-avatar { border-color: #f87171; color: #b91c1c; background: #fef2f2; }
.msg-avatar.buyer-avatar  { border-color: var(--green-glow); color: var(--green-dark); background: var(--green-soft); }

.msg-body { max-width: 72%; }
.msg-sender {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 3px;
    padding: 0 4px;
}
.msg-row.me .msg-sender { text-align: right; }

.msg-bubble {
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}
.msg-row:not(.me) .msg-bubble {
    background: var(--bubble-them);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.msg-row.driver-msg .msg-bubble {
    background: var(--bubble-driver);
    border: 1px solid var(--green-glow);
    border-bottom-left-radius: 4px;
}
.msg-row.me .msg-bubble {
    background: var(--bubble-me);
    color: white;
    font-weight: 500;
    border-bottom-right-radius: 4px;
}
.msg-time {
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px;
    padding: 0 4px;
}
.msg-row.me .msg-time { text-align: right; }

.system-msg {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    padding: 4px 12px;
    margin: 4px auto;
    background: var(--surface2);
    border-radius: 20px;
    max-width: 80%;
}
.status-update-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--green-soft);
    border: 1px solid var(--green-glow);
    border-radius: 8px;
    padding: 8px 14px;
    margin: 4px 0;
    font-size: 12px;
    color: var(--text);
}
.status-update-msg svg { color: var(--green); flex-shrink: 0; }

/* ── CHAT INPUT ─────────────────────────────────────────────── */
.chat-input-area {
    padding: 10px 12px 14px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 6px 8px;
    transition: border-color .15s;
}
.chat-input-row:focus-within { border-color: var(--green); }
.chat-text-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 4px 4px;
}
.chat-text-input::placeholder { color: var(--muted); }
.attach-btn, .mic-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.attach-btn:hover, .mic-btn:hover { color: var(--green); }
.send-btn {
    width: 36px;
    height: 36px;
    background: var(--green);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
    box-shadow: 0 2px 6px rgba(37,189,37,0.35);
}
.send-btn:hover { background: var(--green-mid); }

/* ================================================================
   MAP MARKERS — all green-family, no blue
   ================================================================ */
.leaflet-container { background: var(--surface2); }
.leaflet-control-zoom a {
    background: white !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}
.leaflet-control-attribution { display: none !important; }

.zlm-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    border: 2.5px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
/* Seller = darker green,  Driver = bright green,  Buyer = mid green */
.zlm-seller { background: var(--green-dark); }
.zlm-driver { background: var(--green); animation: driverPulse 2s ease-in-out infinite; }
.zlm-buyer  { background: var(--green-mid); }

@keyframes driverPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 0 0 0 rgba(37,189,37,0.4); }
    50%       { box-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 0 0 10px rgba(37,189,37,0); }
}

/* ================================================================
   RECEIPT MODAL
   ================================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal-box {
    background: white;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin: 0;
    color: var(--text);
    font-weight: 700;
}
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    display: flex;
    align-items: center;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.modal-footer .cta-btn {
    flex: 1;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.modal-footer .ghost-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
    font-family: 'Inter', sans-serif;
}
.modal-footer .ghost-btn:hover { border-color: var(--green); color: var(--green); }

/* receipt content */
.receipt-box { font-size: 13px; color: var(--text); }
.receipt-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.receipt-brand img { width: 36px; height: 36px; border-radius: 8px; }
.receipt-brand-name { font-weight: 700; color: var(--green); font-size: 15px; }
.receipt-brand-tagline { font-size: 11px; color: var(--muted); }
.receipt-meta-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.receipt-meta-row span { color: var(--muted); }
.receipt-title { font-weight: 600; margin: 14px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.receipt-item-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.receipt-item-name { font-weight: 500; }
.receipt-item-qty { font-size: 11px; color: var(--muted); margin-top: 2px; }
.receipt-totals { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.receipt-total-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.receipt-total-row.grand { font-weight: 700; font-size: 14px; margin-top: 6px; border-top: 1px solid var(--border); padding-top: 8px; }
.receipt-footer { margin-top: 16px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.5; }
.receipt-verified { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 6px; color: var(--green); font-weight: 600; }

.receipt-card-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--green-soft);
    border: 1px solid var(--green-glow);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin: 8px auto;
    max-width: 340px;
}
.receipt-card-icon { color: var(--green); flex-shrink: 0; }
.receipt-card-title { font-weight: 600; font-size: 13px; }
.receipt-card-sub { font-size: 12px; color: var(--muted); }
.receipt-card-btn {
    background: var(--green);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
}
.receipt-card-btn:hover { background: var(--green-mid); }

@media print {
    body * { visibility: hidden; }
    #printableReceipt, #printableReceipt * { visibility: visible; }
    #printableReceipt { position: absolute; top: 0; left: 0; width: 100%; }
}

/* ================================================================
   TOAST
   ================================================================ */
.delivery-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--dark);
    color: white;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: all .3s;
    white-space: nowrap;
    z-index: 9999;
    border: 1px solid rgba(37,189,37,0.3);
}
.delivery-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ================================================================
   LOADING STATE
   ================================================================ */
.chat-list-loading {
    padding: 32px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
    .driver-chat-wrap {
        border-left: none;
        border-right: none;
    }
    .driver-form-card {
        border-radius: 12px;
    }
    .driver-gate-title { font-size: 24px; }
}
@media (max-width: 480px) {
    .driver-topbar { padding: 0 16px; }
    .driver-form-body { padding: 20px 16px; }
    .msg-body { max-width: 82%; }
    .chat-messages { padding: 10px 12px; }
}
/* ================================================================
   MULTI-STEP REGISTRATION FORM
   ================================================================ */

/* Step indicator in header */
.reg-step-indicator {
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid var(--green-glow);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Progress bar */
.reg-progress-wrap {
    height: 3px;
    background: var(--border);
    width: 100%;
}
.reg-progress-bar {
    height: 100%;
    background: var(--green);
    transition: width .35s ease;
}

/* Step section heading */
.reg-step-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    margin-top: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.reg-step-heading svg { color: var(--green); flex-shrink: 0; }

/* Required star */
.req { color: var(--danger); margin-left: 2px; }

/* Field note */
.field-note {
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    margin-left: 4px;
}

/* File upload box */
.file-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    min-height: 80px;
}
.file-upload-box:hover {
    border-color: var(--green);
    background: var(--green-soft);
    color: var(--green-dark);
}
.file-upload-box.has-file {
    border-color: var(--green);
    border-style: solid;
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 600;
}
.file-upload-box svg { color: var(--muted); transition: color .15s; }
.file-upload-box:hover svg,
.file-upload-box.has-file svg { color: var(--green); }

/* Radio group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.radio-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    transition: all .15s;
}
.radio-opt:hover { border-color: var(--green); background: var(--green-soft); }
.radio-opt input[type="radio"] { accent-color: var(--green); width: 16px; height: 16px; flex-shrink: 0; }

/* Checkbox group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.checkbox-opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    line-height: 1.5;
}
.checkbox-opt input[type="checkbox"] {
    accent-color: var(--green);
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
}
.doc-link {
    color: var(--green);
    text-decoration: underline;
    font-weight: 600;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}