/* ==========================================
   MiTaxi - Professional Customer App
   Dark theme, mobile-first
   ========================================== */

:root {
    --primary: #FBBF24;
    --primary-dark: #F59E0B;
    --primary-light: rgba(251, 191, 36, 0.12);
    --bg: #0F172A;
    --surface: #1E293B;
    --surface-2: #334155;
    --border: #475569;
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-dim: #64748B;
    --success: #22C55E;
    --danger: #EF4444;
    --info: #3B82F6;
    --warning: #F59E0B;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ==========================================
   Reset & Base
   ========================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ==========================================
   Typography
   ========================================== */
h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
h3 { font-size: 17px; font-weight: 600; }
p { line-height: 1.5; }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    outline: none;
    -webkit-appearance: none;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--transition);
}
.btn:active::after {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: #0F172A;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.btn-primary:disabled::after { display: none; }

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-cancel {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.btn-order {
    margin-top: 16px;
    height: 54px;
    font-size: 17px;
    border-radius: var(--radius);
}

.btn-text { transition: opacity var(--transition); }
.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-top-color: #0F172A;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    border-radius: 50%;
    transition: background var(--transition);
    flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); }

/* ==========================================
   Inputs
   ========================================== */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.input::placeholder { color: var(--text-dim); }

.phone-input {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.phone-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.phone-input .prefix {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    background: var(--surface-2);
    border-right: 1px solid var(--border);
    white-space: nowrap;
}
.phone-input input {
    flex: 1;
    padding: 14px 12px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
    outline: none;
}
.phone-input input::placeholder { color: var(--text-dim); font-weight: 400; letter-spacing: 0; }

.otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 28px 0;
}
.otp-inputs input {
    width: 60px;
    height: 68px;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    caret-color: var(--primary);
}
.otp-inputs input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: scale(1.05);
}

/* ==========================================
   Screens
   ========================================== */
.screen {
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.screen.active {
    display: flex;
    flex-direction: column;
}

/* ==========================================
   Auth Screen
   ========================================== */
#authScreen {
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: var(--bg);
}

.auth-container {
    width: 100%;
    max-width: 380px;
    animation: fadeUp 0.5s ease;
}

.auth-logo {
    text-align: center;
    margin-bottom: 48px;
}
.auth-logo-icon {
    margin-bottom: 16px;
}
.auth-logo h1 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -1px;
}
.auth-logo h1 span { color: var(--primary); }
.auth-logo p {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 15px;
}

.auth-step {
    display: none;
    animation: fadeUp 0.3s ease;
}
.auth-step.active { display: block; }

.timer {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 16px;
    font-size: 15px;
    font-weight: 500;
}
.timer a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}

/* ==========================================
   Map Screen
   ========================================== */
#mapScreen { position: relative; }

#map {
    flex: 1;
    width: 100%;
    z-index: 1;
}

/* Leaflet overrides */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow) !important;
}
.leaflet-control-zoom a {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
}
.leaflet-control-zoom a:first-child {
    border-radius: var(--radius-xs) var(--radius-xs) 0 0 !important;
    border-bottom: 1px solid var(--border) !important;
}
.leaflet-control-zoom a:last-child {
    border-radius: 0 0 var(--radius-xs) var(--radius-xs) !important;
}

/* Top Bar */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 16px;
    padding-top: calc(12px + var(--safe-top));
    display: flex;
    gap: 12px;
    align-items: center;
}

.top-bar-btn {
    width: 48px;
    height: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    color: var(--text);
    transition: all var(--transition);
    flex-shrink: 0;
}
.top-bar-btn:active { transform: scale(0.95); }

.search-bar {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition);
}
.search-bar:active { transform: scale(0.98); }
.search-bar svg { color: var(--text-secondary); flex-shrink: 0; }
.search-bar span { color: var(--text-secondary); font-weight: 400; }

/* Center Pin */
.center-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1000;
    pointer-events: none;
    transform: translate(-50%, -100%);
    animation: pinBounce 0.6s ease;
    transition: opacity var(--transition);
}

@keyframes pinBounce {
    0% { transform: translate(-50%, -150%); opacity: 0; }
    60% { transform: translate(-50%, -90%); }
    80% { transform: translate(-50%, -105%); }
    100% { transform: translate(-50%, -100%); opacity: 1; }
}

.center-pin.pin-moving {
    animation: pinLift 0.15s ease forwards;
}
.center-pin.pin-settled {
    animation: pinDrop 0.3s ease forwards;
}

@keyframes pinLift {
    to { transform: translate(-50%, -115%); }
}
@keyframes pinDrop {
    0% { transform: translate(-50%, -115%); }
    60% { transform: translate(-50%, -97%); }
    100% { transform: translate(-50%, -100%); }
}

/* My Location Button */
.my-location-btn {
    position: absolute;
    right: 16px;
    bottom: 340px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    color: var(--primary);
    transition: all var(--transition);
}
.my-location-btn:active { transform: scale(0.92); }
.my-location-btn:hover { background: var(--surface-2); }

/* ==========================================
   Bottom Panel
   ========================================== */
.bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 12px 20px 20px;
    padding-bottom: calc(20px + var(--safe-bottom));
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    max-height: 75vh;
    overflow-y: auto;
    transform: translateY(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: panelSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-panel[style*="display: none"] {
    transform: translateY(100%);
}

@keyframes panelSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.panel-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}

/* Address Inputs */
.address-inputs {
    display: flex;
    gap: 14px;
    align-items: stretch;
}

.address-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    width: 14px;
    flex-shrink: 0;
}
.dot-pickup {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    flex-shrink: 0;
}
.dot-line {
    width: 2px;
    flex: 1;
    min-height: 16px;
    background: linear-gradient(to bottom, var(--success), var(--danger));
    opacity: 0.4;
    margin: 4px 0;
}
.dot-dest {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    flex-shrink: 0;
}

.address-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.address-input {
    padding: 13px 14px;
    background: var(--bg);
    border: 1.5px solid transparent;
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}
.address-input:hover { border-color: var(--border); }
.address-input::placeholder { color: var(--text-dim); }

/* Vehicle Classes */
.vehicle-classes {
    display: flex;
    gap: 10px;
    margin: 16px 0 12px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.vehicle-classes::-webkit-scrollbar { display: none; }

.vehicle-class {
    flex: 1;
    min-width: 105px;
    padding: 14px 10px 12px;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.vehicle-class:hover { border-color: var(--border); }

.vehicle-class.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.vehicle-class-icon {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}
.vehicle-class-icon svg {
    transition: transform var(--transition);
}
.vehicle-class.active .vehicle-class-icon svg {
    transform: scale(1.1);
}

.vehicle-class-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.vehicle-class-price {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
    margin-top: 4px;
    min-height: 20px;
}
.vehicle-class-time {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Payment Method */
.payment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 0;
    border-top: 1px solid rgba(71, 85, 105, 0.4);
    margin-top: 4px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}
.payment-method:hover { background: var(--surface-2); }
.payment-method:active { transform: scale(0.97); }

.payment-icon {
    display: flex;
    align-items: center;
}
.payment-icon svg { width: 20px; height: 20px; }

.estimated-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

/* ==========================================
   Searching Panel
   ========================================== */
.panel-center {
    text-align: center;
    padding: 12px 0;
}

.searching-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 8px auto 24px;
}
.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.spinner-car {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ==========================================
   Tracking Panel
   ========================================== */
.tracking-content {
    padding: 4px 0;
}

.tracking-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--info);
    animation: statusPulse 1.5s ease infinite;
    flex-shrink: 0;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px transparent; }
}

.status-text {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.eta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.driver-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.driver-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.driver-info { flex: 1; min-width: 0; }
.driver-name {
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.driver-car {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.driver-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 4px;
}

.call-driver-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--success);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
    text-decoration: none;
}
.call-driver-btn:active { transform: scale(0.92); }
.call-driver-btn:hover { background: #16A34A; }

/* ==========================================
   Completed Panel
   ========================================== */
.completed-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto 16px;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.final-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin: 16px 0;
    letter-spacing: -1px;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.star-btn {
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--border);
}
.star-btn:hover { transform: scale(1.2); }
.star-btn:active { transform: scale(0.9); }
.star-btn.active { color: var(--primary); }

.rating-comment {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    margin-bottom: 16px;
    transition: border-color var(--transition);
}
.rating-comment:focus {
    border-color: var(--primary);
}
.rating-comment::placeholder { color: var(--text-dim); }

/* ==========================================
   Search Screen
   ========================================== */
#searchScreen {
    background: var(--bg);
    z-index: 2000;
}

.search-header {
    padding: 8px 8px 8px 4px;
    padding-top: calc(8px + var(--safe-top));
    background: var(--surface);
    display: flex;
    gap: 4px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.search-input-wrap {
    flex: 1;
    position: relative;
}
.search-input-wrap input {
    width: 100%;
    padding: 12px 40px 12px 14px;
    background: var(--bg);
    border: 1.5px solid transparent;
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color var(--transition);
}
.search-input-wrap input:focus { border-color: var(--primary); }
.search-input-wrap input::placeholder { color: var(--text-dim); }

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: var(--surface-2);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.search-clear-btn:hover { background: var(--border); color: var(--text); }

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.search-section-title {
    padding: 12px 20px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background var(--transition);
}
.search-result-item:hover { background: var(--surface); }
.search-result-item:active { background: var(--surface-2); }

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}
.search-result-icon--gps { color: var(--info); background: rgba(59, 130, 246, 0.12); }
.search-result-icon--map { color: var(--success); background: rgba(34, 197, 94, 0.12); }
.search-result-icon--recent { color: var(--text-dim); }
.search-result-icon--place { color: var(--primary); background: var(--primary-light); }

.search-result-text { flex: 1; min-width: 0; }
.search-result-name {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   History Screen
   ========================================== */
#historyScreen {
    background: var(--bg);
    z-index: 1500;
}

.history-header {
    padding: 12px 8px 12px 4px;
    padding-top: calc(12px + var(--safe-top));
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.history-item {
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: transform var(--transition);
}
.history-item:active { transform: scale(0.98); }

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.history-item-uid {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}
.history-item-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.history-item-route { font-size: 14px; }
.history-item-route .from,
.history-item-route .to {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}
.history-item-route .from::before,
.history-item-route .to::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.history-item-route .from::before { background: var(--success); }
.history-item-route .to::before { background: var(--danger); border-radius: 2px; }

.history-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    font-size: 13px;
    color: var(--text-dim);
}
.history-item-price {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    color: var(--text-dim);
}
.history-empty svg { margin-bottom: 16px; opacity: 0.5; }

/* ==========================================
   Side Menu
   ========================================== */
.side-menu {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    pointer-events: none;
}
.side-menu.active {
    display: flex;
    pointer-events: auto;
}

.side-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.35s ease;
}
.side-menu.active .side-menu-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.side-menu-content {
    position: relative;
    width: 300px;
    max-width: 85vw;
    background: var(--surface);
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}
.side-menu.active .side-menu-content {
    transform: translateX(0);
}

.menu-header {
    padding: 32px 24px 20px;
    padding-top: calc(32px + var(--safe-top));
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.menu-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
}

.menu-user-name {
    font-size: 18px;
    font-weight: 700;
}
.menu-user-phone {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}
.menu-user-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    margin-top: 6px;
}

.menu-nav {
    flex: 1;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item:active { background: var(--bg); }
.menu-item svg { color: var(--text-secondary); flex-shrink: 0; }

.menu-item--danger { color: var(--danger); margin-top: auto; }
.menu-item--danger svg { color: var(--danger); }

.menu-divider {
    height: 1px;
    background: rgba(71, 85, 105, 0.3);
    margin: 4px 24px;
}

.menu-footer {
    padding: 16px 24px;
    padding-bottom: calc(16px + var(--safe-bottom));
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}
.toast.show {
    top: calc(20px + var(--safe-top));
}
.toast-info { background: rgba(59, 130, 246, 0.95); color: white; }
.toast-success { background: rgba(34, 197, 94, 0.95); color: white; }
.toast-error { background: rgba(239, 68, 68, 0.95); color: white; }
.toast-warning { background: rgba(245, 158, 11, 0.95); color: #0F172A; }

/* ==========================================
   Animations
   ========================================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ==========================================
   Desktop
   ========================================== */
@media (min-width: 768px) {
    .bottom-panel {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius);
        bottom: 16px;
    }
    @keyframes panelSlideUp {
        from { transform: translateX(-50%) translateY(100%); }
        to { transform: translateX(-50%) translateY(0); }
    }
    .top-bar {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
    }
    .side-menu-content { width: 360px; }
    .my-location-btn {
        right: calc(50% - 230px);
    }
}

@media (min-width: 1024px) {
    .my-location-btn {
        right: calc(50% - 240px);
    }
}
