        :root {
            --bg-dark: #121212; 
            --surface: #1e1e1e; 
            --surface-light: #2a2a2a;
            --primary: #00ff7f; 
            --service: #ffcc00; 
            --danger: #ff0055; 
            --text: #ffffff; 
            --text-sec: #aaaaaa;
        }
        * { 
            margin: 0; 
            padding: 0; 
            box-sizing: border-box; 
            font-family: 'Segoe UI', sans-serif; 
            -webkit-tap-highlight-color: transparent; 
        }
        body { 
            background: var(--bg-dark); 
            color: var(--text); 
            height: 100vh; 
            overflow: hidden; 
            display: flex; 
            flex-direction: column; 
        }
        .hidden { display: none !important; }

        /* AUTH MEJORADO */
        #auth-screen { 
            position: fixed; 
            inset: 0; 
            background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%); 
            z-index: 5000; 
            display: flex; 
            flex-direction: column; 
            justify-content: flex-start; 
            align-items: center; 
            padding: 20px; 
            padding-top: 30px;
            overflow-y: auto; 
            -webkit-overflow-scrolling: touch; 
            gap: 0;
        }
        #auth-screen > * {
            flex-shrink: 0;
        }
        .auth-logo-area { 
            text-align: center; 
            margin-bottom: 16px; 
            animation: fadeIn 1s ease-out; 
            flex-shrink: 0;
        }
        .auth-logo-icon {
            font-size: 3rem; 
            color: var(--primary);
            background: rgba(0, 255, 127, 0.1);
            width: 72px; 
            height: 72px; 
            line-height: 72px;
            border-radius: 50%; 
            margin: 0 auto 10px;
            border: 2px solid var(--primary);
            box-shadow: 0 0 20px rgba(0, 255, 127, 0.3);
        }
        .auth-title { 
            font-size: 1.6rem; 
            font-weight: 800; 
            color: white; 
            letter-spacing: 1px; 
            margin-bottom: 3px; 
        }
        .auth-subtitle { 
            font-size: 0.82rem; 
            color: var(--text-sec); 
            font-weight: 300; 
        }
        .auth-banner {
            background: linear-gradient(135deg, rgba(0,255,127,0.15) 0%, rgba(74,158,255,0.15) 100%);
            border: 1px solid rgba(0,255,127,0.3);
            border-radius: 14px;
            padding: 16px 18px;
            margin: 16px 0 8px 0;
            text-align: center;
            animation: bannerPulse 3s ease-in-out infinite;
        }
        .auth-banner-icon {
            font-size: 1.6rem;
            margin-bottom: 6px;
            display: block;
        }
        .auth-banner-text {
            font-size: 1.05rem;
            font-weight: 700;
            color: #fff;
            line-height: 1.5;
            text-shadow: 0 1px 3px rgba(0,0,0,0.3);
            animation: textBreathe 2.5s ease-in-out infinite;
        }
        @keyframes textBreathe {
            0%, 100% { opacity: 0.6; transform: scale(0.98); }
            50% { opacity: 1; transform: scale(1.02); }
        }
        .auth-banner-text span {
            color: var(--primary);
            display: inline-block;
        }
        @keyframes bannerPulse {
            0%, 100% { border-color: rgba(0,255,127,0.3); box-shadow: 0 0 10px rgba(0,255,127,0.08); }
            50% { border-color: rgba(0,255,127,0.5); box-shadow: 0 0 20px rgba(0,255,127,0.15); }
        }
        .auth-box { 
            background: rgba(30,30,30,0.6); 
            backdrop-filter: blur(20px);
            width: 100%; 
            max-width: 400px; 
            padding: 20px 16px; 
            border-radius: 20px; 
            text-align: center; 
            border: 1px solid rgba(255,255,255,0.05); 
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            animation: slideUpAuth 0.5s ease-out;
            flex-shrink: 0;
            margin-top: 0;
            margin-bottom: 20px;
        }
        @keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
        @keyframes slideUpAuth { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

        .role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 25px 0; }
        .role-card { 
            background: #252525; 
            padding: 20px 10px; 
            border-radius: 15px; 
            cursor: pointer; 
            border: 2px solid transparent; 
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            gap: 10px; 
            transition: all 0.3s ease;
        }
        .role-card.active { 
            border-color: var(--primary); 
            background: rgba(0, 255, 127, 0.1); 
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0, 255, 127, 0.2);
        }
        .role-card i { font-size: 2rem; margin-bottom: 5px; color: var(--text-sec); transition: color 0.3s; }
        .role-card.active i { color: var(--primary); }
        .role-card span { font-weight: 600; font-size: 0.9rem; }

        .input-group { margin-bottom: 20px; text-align: left; }
        .input-group label { display: block; margin-bottom: 8px; color: var(--text-sec); font-size: 0.85rem; font-weight: 600; }
        .input-group input, .input-group select, .input-group textarea { 
            width: 100%; 
            padding: 16px; 
            background: #1a1a1a; 
            border: 1px solid #333; 
            color: white; 
            border-radius: 12px; 
            outline: none; 
            font-size: 1rem; 
            transition: border-color 0.3s;
        }
        .input-group input:focus { border-color: var(--primary); background: #222; }

        .btn-main { 
            width: 100%; 
            padding: 16px; 
            border: none; 
            border-radius: 12px; 
            font-weight: bold; 
            cursor: pointer; 
            margin-top: 10px; 
            font-size: 1rem; 
            transition: transform 0.2s; 
        }
        .btn-main:active { transform: scale(0.98); }
        .btn-enter { background: var(--primary); color: black; box-shadow: 0 4px 15px rgba(0, 255, 127, 0.3); }
        .btn-sec { background: transparent; border: 1px solid #444; color: #aaa; margin-top: 15px; }
        .btn-main:disabled { opacity: 0.6; cursor: wait; }

        /* Sesión con PIN (Fase 1) */
        .auth-step-title { color: #ccc; margin-bottom: 14px; font-size: 1.05rem; }
        .auth-notice {
            background: rgba(0, 255, 127, 0.08); border: 1px solid rgba(0, 255, 127, 0.3); color: #d9ffe9;
            border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: .82rem; line-height: 1.4; text-align: left;
        }
        .auth-notice i { color: var(--primary); margin-right: 6px; }
        .auth-error { color: var(--danger); font-size: .82rem; min-height: 1.1em; margin-top: 10px; }
        .auth-hint { color: #777; font-size: .74rem; margin-top: 10px; line-height: 1.4; }
        .auth-phone-chip {
            display: inline-flex; align-items: center; gap: 8px; background: #1a1a1a; border: 1px solid #333;
            border-radius: 20px; padding: 6px 14px; margin-bottom: 14px; color: #ddd; font-size: .9rem;
        }
        .auth-phone-chip i { color: var(--primary); }
        .pin-input { letter-spacing: .5em; text-align: center; font-size: 1.3rem !important; }
        [data-theme="light"] .auth-phone-chip { background: #f0f0f0; border-color: #ccc; color: #333; }
        [data-theme="light"] .auth-notice { color: #1a5d38; }

        /* HEADER */
        #app-header { 
            position: fixed; 
            top: 10px; 
            left: 10px; 
            right: 10px; 
            background: rgba(30,30,30,0.9); 
            backdrop-filter: blur(10px); 
            padding: 10px 15px; 
            border-radius: 30px; 
            z-index: 2000; 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            border: 1px solid #333; 
        }
        .header-info { display: flex; align-items: center; gap: 10px; cursor: pointer; }
        .header-avatar { 
            width: 36px; 
            height: 36px; 
            border-radius: 50%; 
            object-fit: cover; 
            background: #333; 
            border: 2px solid var(--primary); 
        }
        .icon-btn { 
            background: none; 
            border: none; 
            color: white; 
            font-size: 1.2rem; 
            cursor: pointer; 
            position: relative; 
            margin-left: 15px; 
        }
        .header-btn-pill {
            display: inline-flex !important;
            align-items: center;
            gap: 6px;
            padding: 8px 16px !important;
            background: rgba(255,255,255,0.08) !important;
            border: 1px solid rgba(255,255,255,0.15) !important;
            border-radius: 20px !important;
            color: white !important;
            font-size: 0.78rem !important;
            font-weight: 600;
            margin-left: 8px !important;
            transition: all 0.2s ease;
            white-space: nowrap;
        }
        .header-btn-pill:hover {
            background: rgba(255,255,255,0.15) !important;
            border-color: rgba(255,255,255,0.3) !important;
            transform: translateY(-1px);
        }
        .header-btn-pill:active {
            transform: scale(0.97);
        }
        .header-btn-pill span {
            display: inline;
        }

        /* HAMBURGER MENU - always visible on all screen sizes */
        #hamburger-btn {
            display: block;
            background: none;
            border: none;
            color: white;
            font-size: 1.2rem;
            cursor: pointer;
            padding: 6px 10px;
            margin-left: 4px;
            flex-shrink: 0;
        }
        #header-dropdown {
            display: none;
            position: fixed;
            top: 62px;
            right: 10px;
            background: rgba(30,30,30,0.97);
            backdrop-filter: blur(15px);
            border-radius: 16px;
            border: 1px solid #333;
            padding: 8px;
            z-index: 2100;
            min-width: 190px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.6);
        }
        #header-dropdown.active { display: block; }
        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 11px 14px;
            border-radius: 10px;
            color: white;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
        }
        .dropdown-item:hover { background: rgba(255,255,255,0.08); }
        .dropdown-item i { width: 20px; text-align: center; font-size: 1rem; }

        /* Always hide nav buttons - use hamburger dropdown instead */
        #header-nav-buttons { display: none !important; }

        /* ====== FAB MENU (+) ====== */
        #fab-menu-toggle {
            position: fixed; top: 130px; right: 20px; z-index: 4600;
            width: 56px; height: 56px; border-radius: 50%;
            background: var(--primary); color: #000; border: none;
            font-size: 1.5rem; cursor: pointer;
            box-shadow: 0 4px 15px rgba(0,255,127,0.4);
            transition: transform 0.3s, box-shadow 0.3s;
            display: flex; align-items: center; justify-content: center;
        }
        #fab-menu-toggle:hover { transform: scale(1.05); box-shadow: 0 6px 25px rgba(0,255,127,0.5); }
        #fab-menu-toggle.open { transform: rotate(45deg); background: var(--danger); box-shadow: 0 4px 15px rgba(255,0,85,0.4); }
        #fab-menu-items {
            position: fixed; top: 200px; right: 20px; z-index: 4599;
            display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
            opacity: 0; pointer-events: none; transition: opacity 0.25s;
        }
        #fab-menu-items.open { opacity: 1; pointer-events: auto; }
        .fab-item {
            display: flex; align-items: center; gap: 10px; cursor: pointer;
            animation: fabSlideDown 0.2s ease-out both;
        }
        .fab-item:nth-child(1) { animation-delay: 0s; }
        .fab-item:nth-child(2) { animation-delay: 0.05s; }
        .fab-item:nth-child(3) { animation-delay: 0.1s; }
        .fab-item:nth-child(4) { animation-delay: 0.15s; }
        @keyframes fabSlideDown { from { opacity:0; transform:translateY(-15px); } to { opacity:1; transform:translateY(0); } }
        .fab-label {
            background: rgba(30,30,30,0.95); color: #fff; padding: 6px 12px;
            border-radius: 8px; font-size: 0.78rem; font-weight: 600;
            white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
        }
        .fab-icon {
            width: 44px; height: 44px; border-radius: 50%;
            background: var(--surface); border: 2px solid #333;
            color: #fff; display: flex; align-items: center; justify-content: center;
            font-size: 1.1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            transition: border-color 0.2s;
        }
        .fab-icon:hover { border-color: var(--primary); }

        /* ====== STATUS TOGGLE (conductor) - DEBAJO DE BARRA TOP ====== */
        #status-toggle-float {
            position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
            z-index: 2050;
            display: none; /* se muestra solo para conductores */
        }
        #status-toggle-float.visible { display: block; }
        .status-float-btn {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 20px; border-radius: 25px; cursor: pointer;
            border: 2px solid var(--danger); background: rgba(255,0,85,0.15);
            color: var(--danger); font-weight: 800; font-size: 0.85rem;
            box-shadow: 0 4px 18px rgba(255,0,85,0.3);
            transition: all 0.3s;
            backdrop-filter: blur(10px);
        }
        .status-float-btn.offline {
            border-color: #555; background: rgba(80,80,80,0.25);
            color: #888; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        }
        .status-dot-big {
            width: 12px; height: 12px; border-radius: 50%;
            background: var(--danger); box-shadow: 0 0 8px var(--danger);
        }
        .status-dot-big.off { background: #555; box-shadow: none; }

        /* ====== SOLICITAR SERVICIO BTN (usuario) ====== */
        #request-service-float {
            position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
            z-index: 4550; display: none;
        }
        #request-service-float.visible { display: block; }
        /* Ocultar botones flotantes cuando el menu hamburguesa esta abierto */
        [data-menu-hidden] { display: none !important; opacity: 0 !important; pointer-events: none !important; }
        .request-svc-btn {
            display: flex; align-items: center; justify-content: center; gap: 10px;
            padding: 14px 32px; border-radius: 30px; cursor: pointer;
            border: none; background: var(--primary); color: #000;
            font-weight: 800; font-size: 1rem;
            box-shadow: 0 6px 25px rgba(0,255,127,0.4);
            transition: all 0.2s; min-width: 220px;
        }
        .request-svc-btn:hover { box-shadow: 0 8px 35px rgba(0,255,127,0.5); transform: translateY(-1px); }
        .request-svc-btn:active { transform: scale(0.97); }

        /* ====== SERVICE REQUEST MODAL (nuevo) ====== */
        .svc-modal-overlay {
            position: fixed; inset: 0; z-index: 5000;
            background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
            display: flex; justify-content: center; align-items: flex-end;
        }
        .svc-modal-card {
            background: var(--surface); border-radius: 20px 20px 0 0;
            width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
            animation: svcSlideUp 0.3s ease-out;
        }
        @keyframes svcSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
        .svc-modal-handle { width: 40px; height: 4px; background: #555; border-radius: 2px; margin: 10px auto; }
        .svc-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 15px 0; }
        .svc-type-card {
            background: #252525; border: 2px solid #333; border-radius: 14px;
            padding: 18px 10px; text-align: center; cursor: pointer;
            transition: all 0.3s;
        }
        .svc-type-card:hover { border-color: #555; }
        .svc-type-card.selected { border-color: var(--primary); background: rgba(0,255,127,0.08); }
        .svc-type-card i { font-size: 1.8rem; color: var(--text-sec); margin-bottom: 8px; display: block; }
        .svc-type-card.selected i { color: var(--primary); }
        .svc-type-card span { font-size: 0.85rem; font-weight: 600; }
        .svc-input-group { margin-bottom: 14px; }
        .svc-input-group label { display: block; font-size: 0.78rem; color: var(--text-sec); margin-bottom: 5px; font-weight: 600; }
        .svc-input-group input, .svc-input-group select {
            width: 100%; padding: 14px; background: #1a1a1a; border: 1px solid #333;
            color: #fff; border-radius: 12px; font-size: 0.95rem; outline: none;
        }
        .svc-input-group input:focus { border-color: var(--primary); }
        .svc-submit-btn {
            width: 100%; padding: 16px; border: none; border-radius: 14px;
            background: var(--primary); color: #000; font-weight: 800;
            font-size: 1rem; cursor: pointer; margin-top: 10px;
            box-shadow: 0 4px 15px rgba(0,255,127,0.3);
        }
        .svc-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

        /* ====== REGISTRO: 3 roles (moto/carro/usuario) ====== */
        .role-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 20px 0; }
        .role-grid-3 .role-card { padding: 14px 6px; }
        .role-grid-3 .role-card i { font-size: 1.6rem; }
        .role-grid-3 .role-card span { font-size: 0.78rem; }

        /* ====== INCOMING RIDE POPUP (taxista) ====== */
        #incoming-ride-popup {
            position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0);
            z-index: 10003; background: var(--surface); border: 2px solid var(--primary);
            border-radius: 20px; padding: 25px; width: 90%; max-width: 400px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.6);
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            max-height: 90vh; overflow-y: auto;
        }
        #incoming-ride-popup.visible { transform: translate(-50%,-50%) scale(1); box-shadow: 0 0 0 9999px rgba(0,0,0,0.8), 0 20px 60px rgba(0,0,0,0.6); }
        .ride-timer-ring {
            width: 60px; height: 60px; border-radius: 50%;
            border: 4px solid #333; border-top-color: var(--primary);
            display: flex; align-items: center; justify-content: center;
            font-size: 1.3rem; font-weight: 800; color: var(--primary);
            animation: timerSpin 1s linear infinite;
            margin: 0 auto 15px;
        }
        @keyframes timerSpin { from { border-top-color: var(--primary); } 50% { border-top-color: var(--danger); } to { border-top-color: var(--primary); } }

        .badge { 
            position: absolute; 
            top: -5px; 
            right: -5px; 
            background: var(--danger); 
            color: white; 
            width: 18px; 
            height: 18px; 
            border-radius: 50%; 
            font-size: 10px; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            border: 2px solid var(--surface); 
            transform: scale(0); 
        }
        .badge.visible { transform: scale(1); }

        /* DRAWER */
        #users-drawer { 
            position: fixed; 
            top: 75px; 
            right: 10px; 
            z-index: 1500; 
            width: 280px; 
            max-height: 70vh; 
            overflow-y: auto; 
            background: #1a1a1a; 
            border-radius: 15px; 
            padding: 10px; 
            border: 1px solid #333; 
            transform: translateX(120%); 
            transition: transform 0.3s; 
            box-shadow: -5px 5px 20px rgba(0,0,0,0.5); 
        }
        #users-drawer.active { transform: translateX(0); }
        .user-item { 
            display: flex; 
            align-items: center; 
            gap: 12px; 
            padding: 12px; 
            border-bottom: 1px solid #333; 
            cursor: pointer; 
        }
        .user-item:hover { background: rgba(255,255,255,0.05); }
        .mini-avatar { 
            width: 45px; 
            height: 45px; 
            border-radius: 50%; 
            background: #333; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            position: relative; 
            flex-shrink: 0; 
            overflow: hidden; 
        }
        .status-dot { 
            position: absolute; 
            bottom: 0; 
            right: 0; 
            width: 12px; 
            height: 12px; 
            border-radius: 50%; 
            border: 2px solid #1a1a1a; 
        }

        /* MAPA */
        #map { width: 100%; height: 100%; z-index: 1; }
        .custom-pin-user { 
            background: var(--primary); 
            color: black; 
            border-radius: 50%; 
            border: 2px solid white; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
        }
        .custom-pin-service {
            background: #facc15;
            color: black;
            border-radius: 8px;
            border: 3px solid var(--primary);
            transform: rotate(45deg);
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        }
        .custom-pin-service i { transform: rotate(-45deg); }

        /* SHOP PIN EFFECTS */
        @keyframes shopPulse {
            0% { box-shadow: 0 0 0 0 rgba(0,255,127,0.6); }
            70% { box-shadow: 0 0 0 12px rgba(0,255,127,0); }
            100% { box-shadow: 0 0 0 0 rgba(0,255,127,0); }
        }
        @keyframes shopGlow {
            0%, 100% { filter: drop-shadow(0 0 4px rgba(0,255,127,0.5)); }
            50% { filter: drop-shadow(0 0 12px rgba(0,255,127,0.9)); }
        }
        @keyframes shopShimmer {
            0% { left: -100%; }
            50% { left: 100%; }
            100% { left: 100%; }
        }
        .pin-effect-pulse { animation: shopPulse 1.5s infinite; }
        .pin-effect-glow { animation: shopGlow 2s ease-in-out infinite; }
        .pin-shield-badge {
            position: absolute; bottom: -2px; right: -6px;
            background: #ffd700; color: #000; font-size: 0.5rem;
            width: 14px; height: 14px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            border: 1.5px solid #fff; z-index: 2;
        }
        .pin-vip-badge {
            position: absolute; top: -8px; right: -8px;
            font-size: 0.7rem; z-index: 2;
            text-shadow: 0 0 6px rgba(255,215,0,0.8);
            -webkit-text-stroke: 1px #000;
            paint-order: stroke fill;
            animation: vipCrownBounce 2s ease-in-out infinite;
        }
        @keyframes vipCrownBounce {
            0%, 100% { transform: translateY(0) scale(1); }
            50% { transform: translateY(-2px) scale(1.1); }
        }

        /* LOADING INDICATOR */
        .loading-markers {
            position: fixed; 
            bottom: 100px; 
            left: 50%; 
            transform: translateX(-50%);
            background: rgba(0,0,0,0.8); 
            padding: 10px 20px; 
            border-radius: 20px;
            color: white; 
            font-size: 0.9rem; 
            z-index: 1000; 
            display: none;
        }
        .loading-markers.visible { display: block; }

        /* MODALES */
        .modal-overlay { 
            position: fixed; 
            inset: 0; 
            background: rgba(0,0,0,0.8); 
            z-index: 3000; 
            display: none; 
            justify-content: center; 
            align-items: flex-end; 
        }
        .modal-overlay.active { display: flex; }
        .modal-card { 
            background: var(--surface); 
            width: 100%; 
            max-width: 500px; 
            border-radius: 20px 20px 0 0; 
            padding: 0; 
            max-height: 90vh; 
            display: flex; 
            flex-direction: column; 
            border-top: 1px solid var(--primary); 
            animation: slideUp 0.3s; 
            overflow-y: auto; 
        }
        @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

        /* FICHA PERFIL */
        .profile-card-header { 
            padding: 25px; 
            text-align: center; 
            background: #252525; 
            border-bottom: 1px solid #333; 
            flex-shrink: 0; 
        }
        .profile-big-avatar { 
            width: 90px; 
            height: 90px; 
            border-radius: 50%; 
            object-fit: cover; 
            background: #333; 
            margin: 0 auto 15px; 
            border: 3px solid var(--primary); 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            font-size: 2.5rem; 
            overflow: hidden; 
        }
        .driver-details { 
            background: #1a1a1a; 
            padding: 10px; 
            border-radius: 8px; 
            margin-top: 10px; 
            font-size: 0.85rem; 
            color: #ccc; 
            border: 1px solid #333; 
        }
        .detail-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
        .detail-val { color: white; font-weight: bold; }
        
        .profile-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 20px; }
        .action-btn { 
            padding: 15px; 
            border: none; 
            border-radius: 12px; 
            font-weight: bold; 
            cursor: pointer; 
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            gap: 5px; 
            transition: 0.2s; 
        }
        .action-btn i { font-size: 1.5rem; }
        .btn-profile { background: #333; color: white; border: 1px solid #444; }
        .btn-request { background: var(--primary); color: black; }
        .btn-chat { background: var(--surface-light); color: white; border: 1px solid #555; }

        /* ESTADÍSTICAS DE CONDUCTOR */
        .profile-stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin: 15px 0;
        }
        .profile-stat {
            background: rgba(0,0,0,0.3);
            padding: 12px;
            border-radius: 10px;
            text-align: center;
        }
        .profile-stat-value {
            font-size: 1.3rem;
            font-weight: bold;
            color: var(--primary);
        }
        .profile-stat-label {
            font-size: 0.7rem;
            color: #aaa;
            text-transform: uppercase;
        }

        /* ZONES DISPLAY */
        .zones-display {
            background: rgba(0, 255, 127, 0.1);
            border: 1px solid var(--primary);
            padding: 12px;
            border-radius: 8px;
            margin: 10px 0;
        }
        .zones-tag {
            display: inline-block;
            background: var(--primary);
            color: black;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            margin: 2px;
            font-weight: bold;
        }

        /* ADMIN BROADCAST POPUP */
        .broadcast-popup {
            position: fixed;
            top: 80px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 9999;
            min-width: 300px;
            max-width: 90vw;
            padding: 16px 20px;
            background: rgba(0, 0, 0, 0.92);
            border: 2px solid #ff0055;
            border-radius: 14px;
            box-shadow: 0 0 30px rgba(255, 0, 85, 0.4), 0 8px 32px rgba(0,0,0,0.6);
            animation: broadcastSlideIn 0.4s ease-out;
            cursor: pointer;
            text-align: center;
        }
        .broadcast-popup.fade-out {
            animation: broadcastFadeOut 0.5s ease-in forwards;
        }
        @keyframes broadcastSlideIn {
            from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.95); }
            to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
        }
        @keyframes broadcastFadeOut {
            from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
            to { opacity: 0; transform: translateX(-50%) translateY(-15px) scale(0.95); }
        }
        .broadcast-label {
            color: #ff0055;
            font-weight: 900;
            font-size: 1rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 6px;
        }
        .broadcast-text {
            color: #ff0055;
            font-size: 1.3rem;
            font-weight: 700;
            line-height: 1.4;
        }

        /* BADGE DE EXPERIENCIA */
        .experience-badge {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 0.8rem;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            margin-top: 10px;
        }

        /* RATING DISPLAY */
        .rating-display { 
            text-align: center; 
            margin-top: 15px; 
            padding: 15px; 
            background: rgba(255, 204, 0, 0.1); 
            border: 1px solid var(--service); 
            border-radius: 10px; 
        }
        .rating-stars { font-size: 1.8rem; color: gold; }
        .rating-avg { font-size: 2rem; font-weight: bold; color: var(--service); }
        .rating-total { font-size: 0.85rem; color: #aaa; }

        /* REVIEWS SECTION */
        .reviews-section { 
            padding: 15px; 
            border-top: 1px solid #333; 
            max-height: 200px; 
            overflow-y: auto; 
        }
        .review-item { 
            padding: 10px; 
            border-bottom: 1px solid #333; 
            font-size: 0.85rem; 
        }
        .review-header { 
            display: flex; 
            justify-content: space-between; 
            margin-bottom: 5px; 
        }
        .review-stars { color: gold; font-size: 0.9rem; }
        .review-date { color: #666; font-size: 0.7rem; }
        .review-comment { color: #ccc; font-style: italic; }

        /* CHAT & RIDE */
        .chat-header { 
            padding: 15px; 
            background: var(--surface-light); 
            border-bottom: 1px solid #333; 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            flex-shrink: 0; 
        }
        .chat-body { 
            flex: 1; 
            overflow-y: auto; 
            padding: 15px; 
            padding-top: 10px;
            background: #181818; 
            display: flex; 
            flex-direction: column; 
            gap: 10px; 
            min-height: 80px;
            scroll-behavior: smooth;
        }
        .msg { 
            max-width: 75%; 
            padding: 10px 15px; 
            border-radius: 15px; 
            font-size: 0.95rem; 
            line-height: 1.4; 
            word-wrap: break-word; 
        }
        .msg-own { 
            align-self: flex-end; 
            background: var(--primary); 
            color: black; 
            border-bottom-right-radius: 2px; 
        }
        .msg-other { 
            align-self: flex-start; 
            background: #333; 
            color: white; 
            border-bottom-left-radius: 2px; 
        }
        
        /* TYPING INDICATOR */
        .typing-indicator {
            padding: 10px 15px;
            background: #333;
            border-radius: 15px;
            display: none;
            align-items: center;
            gap: 5px;
            font-size: 0.8rem;
            color: #aaa;
        }
        .typing-indicator.active { display: flex; }
        .typing-dot {
            width: 6px; height: 6px; background: #aaa;
            border-radius: 50%;
            animation: typingBounce 1.4s infinite ease-in-out;
        }
        .typing-dot:nth-child(1) { animation-delay: -0.32s; }
        .typing-dot:nth-child(2) { animation-delay: -0.16s; }

        @keyframes typingBounce {
            0%, 80%, 100% { transform: scale(0); }
            40% { transform: scale(1); }
        }

        /* QUICK REPLIES */
        .chat-quick-replies {
            padding: 10px;
            background: var(--surface-light);
            border-top: 1px solid #333;
            overflow-x: auto;
            display: flex;
            gap: 8px;
            scrollbar-width: thin;
        }
        .quick-reply-btn {
            background: #333;
            color: white;
            border: 1px solid #444;
            padding: 8px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            white-space: nowrap;
            cursor: pointer;
            transition: background 0.2s;
        }
        .quick-reply-btn:hover { background: #444; }
        .quick-reply-btn.location { border-color: var(--primary); color: var(--primary); }

        .msg-location {
            background: rgba(0, 255, 127, 0.1);
            border: 1px solid var(--primary);
            padding: 15px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .msg-location i { font-size: 1.5rem; color: var(--primary); }
        .msg-location a {
            color: var(--primary);
            text-decoration: none;
            font-weight: bold;
        }
        .msg-system {
            text-align: center;
            padding: 4px 0;
        }
        .system-msg-bubble {
            display: inline-block;
            background: linear-gradient(135deg, rgba(0,184,94,0.15), rgba(255,215,0,0.15));
            border: 1px solid rgba(0,184,94,0.3);
            color: var(--primary);
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.78rem;
            font-weight: 600;
            max-width: 85%;
        }
        .system-msg-bubble i {
            margin-right: 5px;
            color: var(--service);
        }

        .ride-panel { 
            background: #252525; 
            padding: 15px; 
            border-top: 1px solid #444; 
            flex-shrink: 0; 
            max-height: 40vh;
            overflow-y: auto;
            transition: max-height 0.3s ease, padding 0.3s ease;
        }
        .ride-panel.collapsed {
            max-height: 50px;
            overflow: hidden;
            padding: 10px 15px;
        }
        .ride-panel-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #aaa;
            font-size: 0.75rem;
            gap: 5px;
            padding: 5px 0;
            border-bottom: 1px solid #333;
            user-select: none;
        }
        .ride-panel-toggle:hover { color: white; }
        .ride-panel-toggle i { transition: transform 0.3s; }
        .ride-panel-toggle.collapsed i { transform: rotate(180deg); }
        .ride-status { 
            text-align: center; 
            font-weight: bold; 
            color: var(--primary); 
            margin-bottom: 10px; 
            text-transform: uppercase; 
            font-size: 0.9rem; 
        }
        .btn-ride { 
            width: 100%; 
            padding: 12px; 
            border: none; 
            border-radius: 8px; 
            font-weight: bold; 
            cursor: pointer; 
            margin-bottom: 8px; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            gap: 8px; 
        }
        .btn-accept { background: var(--primary); color: black; }
        .btn-reject { background: var(--danger); color: white; }
        .btn-finish { background: var(--service); color: black; }
        .btn-sec-ride { background: #555; color: white; }

        .final-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

        /* RATING - Usado solo en perfil de conductor (visualización, no input) */

        .rating-summary {
            background: rgba(255, 204, 0, 0.1);
            border: 1px solid var(--service);
            padding: 15px;
            border-radius: 10px;
            margin: 10px 0;
            text-align: center;
        }
        .summary-stars {
            font-size: 2rem;
            color: gold;
            margin-bottom: 5px;
        }
        .summary-score {
            font-size: 1.5rem;
            font-weight: bold;
            color: var(--service);
        }

        /* HISTORIAL DETALLADO */
        .ride-history-card {
            background: rgba(0,0,0,0.3);
            border: 1px solid #333;
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 10px;
        }
        .ride-history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        .ride-history-date {
            font-size: 0.8rem;
            color: #888;
        }
        .ride-history-route {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 10px 0;
        }
        .ride-point {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        .ride-point-dot {
            width: 12px; height: 12px; border-radius: 50%; background: var(--primary);
        }
        .ride-point-end { background: var(--danger); }
        .ride-point-line {
            width: 2px; min-height: 30px; background: #444;
        }
        .ride-point-address {
            font-size: 0.85rem; color: #ccc;
        }
        .ride-history-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #333;
        }
        .ride-cost {
            font-size: 1.2rem;
            font-weight: bold;
            color: var(--service);
        }
        .ride-history-stars {
            color: gold;
            font-size: 0.9rem;
        }
        .ride-status-badge {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: bold;
            text-transform: uppercase;
        }
        .ride-status-completed { background: rgba(0,255,128,0.2); color: var(--primary); }
        .ride-status-cancelled { background: rgba(255,0,85,0.2); color: var(--danger); }

        /* HISTORY LIST */
        .history-list { 
            padding: 0 20px 20px 20px; 
            max-height: 250px; 
            overflow-y: auto; 
        }
        .history-item { 
            padding: 10px; 
            border-bottom: 1px solid #333; 
            font-size: 0.9rem; 
            display: flex; 
            flex-direction: column; 
            gap: 5px; 
        }
        .history-header { display: flex; justify-content: space-between; align-items: center; }
        .history-status { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; font-weight: bold; }
        .st-completed { background: rgba(0,255,127,0.2); color: var(--primary); }
        .st-cancelled { background: rgba(255,0,85,0.2); color: var(--danger); }
        .history-stars { color: gold; font-size: 0.8rem; }

        /* PROFILE TABS */
        .profile-tabs {
            display: flex;
            border-bottom: 2px solid #333;
            background: #1a1a1a;
            flex-shrink: 0;
        }
        .profile-tab {
            flex: 1;
            padding: 12px 8px;
            text-align: center;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: bold;
            color: #888;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: all 0.2s;
            text-transform: uppercase;
        }
        .profile-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }
        .profile-tab:hover {
            color: #ccc;
        }
        .profile-tab-content {
            display: none;
            padding: 15px;
        }
        .profile-tab-content.active {
            display: block;
        }
        .user-history-list {
            max-height: 300px;
            overflow-y: auto;
        }
        .no-history-msg {
            text-align: center;
            color: #666;
            padding: 30px 20px;
            font-size: 0.9rem;
        }

        /* NOTIFICACIONES */
        #snackbar-container {
            position: fixed; bottom: 15px; left: 50%; transform: translateX(-50%);
            width: 92%; max-width: 460px; z-index: 4500;
            display: flex; flex-direction: column; gap: 8px;
            pointer-events: none;
            max-height: 60vh; overflow-y: auto;
            scrollbar-width: thin; scrollbar-color: #555 transparent;
        }
        #snackbar-container::-webkit-scrollbar { width: 4px; }
        #snackbar-container::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }
        .snackbar {
            background: rgba(40, 40, 40, 0.95); backdrop-filter: blur(10px);
            border-left: 5px solid var(--primary);
            border-radius: 12px; padding: 18px 16px;
            box-shadow: 0 8px 25px rgba(0,0,0,0.5);
            color: white; display: flex; align-items: center; gap: 10px;
            animation: slideInUp 0.3s ease-out; pointer-events: auto;
            transition: opacity 0.3s, transform 0.3s;
            min-height: 70px;
        }
        .snackbar.type-service { border-left-color: var(--service); }
        .snackbar-content { flex: 1; cursor: pointer; min-width: 0; }
        .snackbar-content h4 { font-size: 1.05rem; margin-bottom: 4px; color: white; font-weight: 700; }
        .snackbar-content p { font-size: 0.9rem; color: #ccc; line-height: 1.3; }
        .snackbar-close {
            background: rgba(255,255,255,0.1); border: none; color: #888;
            width: 30px; height: 30px; min-width: 30px; border-radius: 50%;
            display: flex; justify-content: center; align-items: center;
            font-size: 1rem; cursor: pointer; transition: all 0.2s; padding: 0;
        }
        .snackbar-close:hover { background: var(--danger); color: white; }
        .snackbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
        .btn-snackbar-action {
            background: transparent; border: 1px solid var(--danger); color: var(--danger);
            padding: 8px 14px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; white-space: nowrap;
            font-weight: 600;
        }
        .btn-snackbar-action:hover { background: var(--danger); color: white; }

        /* ICONO FAB */
        #notification-fab {
            position: fixed; top: 50%; right: 15px;
            width: 50px; height: 50px; border-radius: 50%;
            background: var(--surface); border: 2px solid var(--primary);
            color: var(--primary); display: flex; justify-content: center; align-items: center;
            font-size: 1.2rem; z-index: 4400; cursor: pointer;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
            transform: translateY(-50%) scale(0);
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        #notification-fab.visible { transform: translateY(-50%) scale(1); }
        #notification-fab.pulse { animation: pulse-animation 2s infinite; }

        /* AVATARES Y PAGO */
        .avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 10px; }
        .avatar-option { 
            width: 100%; aspect-ratio: 1; 
            border-radius: 50%; cursor: pointer; 
            border: 2px solid transparent; 
            display: flex; justify-content: center; align-items: center; 
            font-size: 1.5rem; background: #333;
            transition: transform 0.2s, border-color 0.2s;
        }
        .avatar-option:hover { transform: scale(1.1); }
        .avatar-option.selected { border-color: var(--primary); transform: scale(1.1); box-shadow: 0 0 10px var(--primary); }
        
        .payment-info-box { background: rgba(255, 204, 0, 0.1); border: 1px solid var(--service); padding: 15px; border-radius: 8px; margin-top: 15px; }
        .payment-info-box h5 { color: var(--service); margin-bottom: 10px; }

        @keyframes slideInUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        @keyframes pulse-animation { 0% { box-shadow: 0 0 0 0 rgba(0, 255, 127, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(0, 255, 127, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 255, 127, 0); } }

        /* SALA GENERAL / LOBBY */
        .lobby-card {
            background: #222;
            border: 1px solid #333;
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 10px;
            transition: background 0.2s;
        }
        .lobby-card:hover { background: #2a2a2a; cursor: pointer; }
        .lobby-detail-modal {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10000;
            background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center;
            animation: fadeIn 0.2s;
        }
        .lobby-detail-card {
            background: #1e1e1e; border-radius: 16px; width: 95%; max-width: 420px;
            max-height: 90vh; overflow-y: auto; border: 1px solid #333;
            box-shadow: 0 10px 40px rgba(0,0,0,0.6);
        }
        .lobby-detail-map {
            width: 100%; height: 250px; border-radius: 16px 16px 0 0; overflow: hidden;
            position: relative; z-index: 1;
        }
        .lobby-detail-map .leaflet-control-zoom {
            border: none !important;
        }
        .lobby-detail-map .leaflet-control-zoom a {
            background: rgba(0,0,0,0.7) !important; color: #ffd700 !important;
            border: 1px solid #ffd700 !important; border-radius: 8px !important;
            width: 32px !important; height: 32px !important; line-height: 32px !important;
        }
        .lobby-detail-body { padding: 16px; }
        .lobby-detail-close {
            position: absolute; top: 10px; right: 10px; z-index: 10;
            background: rgba(0,0,0,0.6); color: white; border: none; border-radius: 50%;
            width: 36px; height: 36px; font-size: 1.2rem; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
        }
        .lobby-detail-route {
            display: flex; flex-direction: column; gap: 8px; margin: 12px 0;
            padding: 12px; background: rgba(255,255,255,0.05); border-radius: 10px;
        }
        .lobby-detail-route-point {
            display: flex; align-items: center; gap: 10px; font-size: 0.85rem;
        }
        .lobby-detail-route-dot {
            width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
        }
        .lobby-detail-route-line {
            width: 2px; height: 20px; background: #444; margin-left: 5px;
        }
        .lobby-detail-actions {
            display: flex; flex-direction: column; gap: 8px; margin-top: 14px;
        }
        .lobby-detail-actions button {
            width: 100%; padding: 12px; border: none; border-radius: 10px;
            font-weight: 700; font-size: 0.9rem; cursor: pointer;
            display: flex; align-items: center; justify-content: center; gap: 8px;
        }
        .lobby-detail-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 8px 0; border-bottom: 1px solid #2a2a2a;
        }
        .lobby-detail-row:last-child { border-bottom: none; }
        .lobby-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        .lobby-avatar {
            width: 36px; height: 36px; border-radius: 50%; background: #333;
            display: flex; justify-content: center; align-items: center; flex-shrink: 0;
            font-size: 0.9rem;
        }
        .lobby-route {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
            color: #ccc;
            margin: 6px 0;
        }
        .lobby-route-arrow { color: var(--primary); }
        .lobby-cost {
            font-size: 1.1rem;
            font-weight: bold;
            color: var(--service);
        }
        .lobby-actions {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }
        .lobby-btn {
            flex: 1;
            padding: 8px;
            border: none;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        .lobby-btn-profile { background: #333; color: white; border: 1px solid #444; }
        .lobby-btn-profile:hover { background: #444; }
        .lobby-btn-contact { background: var(--primary); color: black; }
        .lobby-btn-contact:hover { opacity: 0.9; }
        .lobby-time { font-size: 0.7rem; color: #666; }
        .lobby-empty {
            text-align: center;
            padding: 30px;
            color: #666;
        }
        .lobby-post-form {
            background: #1a1a1a;
            border: 1px solid #333;
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 15px;
        }
        .lobby-input-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-bottom: 8px;
        }
        .lobby-input {
            width: 100%;
            padding: 10px;
            background: #252525;
            border: 1px solid #444;
            color: white;
            border-radius: 8px;
            font-size: 0.85rem;
        }
        .lobby-input:focus { border-color: var(--primary); outline: none; }
        .lobby-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: rgba(255, 204, 0, 0.15);
            color: var(--service);
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 0.7rem;
            font-weight: bold;
        }

        /* NEGOCIACIÓN DE PRECIO */
        .price-negotiation {
            background: rgba(255, 204, 0, 0.08);
            border: 1px solid var(--service);
            border-radius: 10px;
            padding: 12px;
            margin: 8px 0;
        }
        .price-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 5px 0;
            font-size: 0.85rem;
        }
        .price-label { color: #aaa; }
        .price-value { font-weight: bold; }
        .price-counter { color: var(--primary); }
        .price-input-row {
            display: flex;
            gap: 8px;
            margin: 10px 0;
        }
        .price-input {
            flex: 1;
            padding: 10px;
            background: #1a1a1a;
            border: 1px solid var(--service);
            color: white;
            border-radius: 8px;
            font-size: 1rem;
            text-align: center;
        }
        .price-input:focus { outline: none; border-color: var(--primary); }

        /* SOLICITAR CARRERA DESDE CHAT */
        .chat-service-bar {
            background: rgba(0, 255, 127, 0.08);
            border-top: 1px solid rgba(0, 255, 127, 0.2);
            padding: 10px;
            text-align: center;
            flex-shrink: 0;
        }
        .btn-chat-service {
            background: var(--primary);
            color: black;
            border: none;
            padding: 10px 20px;
            border-radius: 20px;
            font-weight: bold;
            cursor: pointer;
            font-size: 0.85rem;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .btn-chat-service:hover { opacity: 0.9; }
    
    /* ==============================
       V7 NEW FEATURES - CSS
       ============================== */

    /* === MODO OSCURO/CLARO === */
    [data-theme="light"] {
        --bg-dark: #f5f5f5;
        --surface: #ffffff;
        --surface-light: #f0f0f0;
        --text: #1a1a1a;
        --text-sec: #666666;
    }
    [data-theme="light"] body { background: #f5f5f5; color: #1a1a1a; }
    [data-theme="light"] #auth-screen { background: linear-gradient(135deg, #e8e8e8 0%, #ffffff 100%); }
    [data-theme="light"] .auth-title { color: #1a1a1a; }
    [data-theme="light"] .auth-box { background: rgba(255,255,255,0.9); border: 1px solid #ddd; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
    [data-theme="light"] .input-group input,
    [data-theme="light"] .input-group select,
    [data-theme="light"] .input-group textarea { background: #f0f0f0; border: 1px solid #ccc; color: #333; }
    [data-theme="light"] .input-group input:focus { background: #fff; border-color: #00b85e; }
    [data-theme="light"] .input-group label { color: #666; }
    [data-theme="light"] #app-header { background: rgba(255,255,255,0.95); border: 1px solid #ddd; }
    [data-theme="light"] .header-avatar { border-color: #00b85e; }
    [data-theme="light"] .icon-btn { color: #333; }
    [data-theme="light"] #header-dropdown { background: rgba(255,255,255,0.97); border: 1px solid #ddd; box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
    [data-theme="light"] .dropdown-item { color: #333; }
    [data-theme="light"] .dropdown-item:hover { background: rgba(0,0,0,0.05); }
    [data-theme="light"] #hamburger-btn { color: #333; }
    [data-theme="light"] #users-drawer { background: #fff; border: 1px solid #ddd; }
    [data-theme="light"] .user-item { border-bottom: 1px solid #eee; }
    [data-theme="light"] .modal-card { background: #fff; border-top: 1px solid #00b85e; }
    [data-theme="light"] .profile-card-header { background: #f5f5f5; border-bottom: 1px solid #eee; }
    [data-theme="light"] .driver-details { background: #f0f0f0; border: 1px solid #ddd; color: #333; }
    [data-theme="light"] .detail-val { color: #000; }
    [data-theme="light"] .chat-header { background: #f0f0f0; border-bottom: 1px solid #ddd; }
    [data-theme="light"] .chat-body { background: #f8f8f8; }
    [data-theme="light"] .msg-other { background: #e8e8e8; color: #333; }
    [data-theme="light"] .system-msg-bubble { background: linear-gradient(135deg, rgba(0,184,94,0.1), rgba(255,215,0,0.1)); border-color: rgba(0,184,94,0.4); color: #1a7a3e; }
    [data-theme="light"] .ride-panel { background: #f5f5f5; border-top: 1px solid #ddd; }
    [data-theme="light"] .action-btn { color: #333; }
    [data-theme="light"] .btn-profile { background: #e8e8e8; border: 1px solid #ccc; }
    [data-theme="light"] .profile-stats-grid .profile-stat { background: rgba(0,0,0,0.05); }
    [data-theme="light"] .typing-indicator { background: #e8e8e8; }
    [data-theme="light"] .typing-dot { background: #999; }
    [data-theme="light"] .quick-reply-btn { background: #e8e8e8; color: #333; border: 1px solid #ccc; }
    [data-theme="light"] .quick-reply-btn:hover { background: #ddd; }
    [data-theme="light"] .snackbar { background: rgba(255,255,255,0.97); border-left: 5px solid #00b85e; color: #333; box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
    [data-theme="light"] .snackbar-content h4 { color: #000; }
    [data-theme="light"] .snackbar-content p { color: #555; }
    [data-theme="light"] .snackbar-close { color: #aaa; }
    [data-theme="light"] .snackbar-close:hover { background: #ff0055; color: white; }
    [data-theme="light"] .chat-input-area { background: #fff; }
    [data-theme="light"] .chat-input-area input { background: #f0f0f0; color: #333; border: 1px solid #ddd; }
    [data-theme="light"] .chat-quick-replies { background: #f0f0f0; }
    [data-theme="light"] .chat-service-bar { background: rgba(0,180,94,0.08); border-top: 1px solid rgba(0,180,94,0.2); }
    [data-theme="light"] .lobby-card { background: #fff; border: 1px solid #eee; }
    [data-theme="light"] .lobby-card:hover { background: #f8f8f8; }
    [data-theme="light"] .lobby-detail-card { background: #fff; border: 1px solid #ddd; }
    [data-theme="light"] .lobby-detail-route { background: rgba(0,0,0,0.03); }
    [data-theme="light"] .lobby-detail-row { border-bottom-color: #eee; }
    [data-theme="light"] .lobby-post-form { background: #f8f8f8; border: 1px solid #eee; }
    [data-theme="light"] .lobby-input { background: #fff; border: 1px solid #ddd; color: #333; }
    [data-theme="light"] .lobby-input:focus { border-color: #00b85e; }
    [data-theme="light"] .lobby-btn-profile { background: #e8e8e8; color: #333; border: 1px solid #ccc; }
    [data-theme="light"] .role-card { background: #fff; border: 1px solid #eee; }
    [data-theme="light"] .role-card i { color: #999; }
    [data-theme="light"] .profile-tabs { background: #f5f5f5; border-bottom: 2px solid #eee; }
    [data-theme="light"] .review-item { border-bottom: 1px solid #eee; }
    [data-theme="light"] .ride-history-card { background: #fff; border: 1px solid #eee; }
    [data-theme="light"] .ride-history-address { color: #555; }
    [data-theme="light"] #notification-fab { background: #fff; border: 2px solid #00b85e; color: #00b85e; }
    [data-theme="light"] #fab-menu-toggle { background: #00b85e; color: #fff; }
    [data-theme="light"] #fab-menu-toggle.open { background: #ff0055; }
    [data-theme="light"] .fab-label { background: #fff; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
    [data-theme="light"] .fab-icon { background: #fff; border-color: #ddd; color: #333; }
    [data-theme="light"] .status-float-btn { background: rgba(255,0,85,0.08); border-color: #cc0044; color: #cc0044; }
    [data-theme="light"] .status-float-btn.offline { background: rgba(0,0,0,0.05); border-color: #ccc; color: #999; }
    [data-theme="light"] #status-toggle-float { box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
    [data-theme="light"] .request-svc-btn { background: #00b85e; color: #fff; }

    /* ====== MIS ORDENES BTN (conductor) ====== */
    #my-orders-float {
        position: fixed; bottom: 90px; right: 20px; z-index: 2050;
        display: none;
    }
    #my-orders-float.visible { display: block; }
    .my-orders-float-btn {
        display: flex; align-items: center; justify-content: center; gap: 8px;
        width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
        border: 2px solid var(--blue); background: rgba(59,130,246,0.18);
        color: var(--blue); font-size: 1.3rem;
        box-shadow: 0 4px 18px rgba(59,130,246,0.35);
        transition: all 0.3s; backdrop-filter: blur(10px);
    }
    .my-orders-float-btn.has-orders {
        border-color: var(--primary); background: rgba(0,255,127,0.18);
        color: var(--primary); box-shadow: 0 4px 18px rgba(0,255,127,0.4);
        animation: pulse-orders 2s infinite;
    }
    .orders-badge {
        position: absolute; top: -4px; right: -4px;
        background: var(--danger); color: #fff; font-size: 0.65rem;
        width: 18px; height: 18px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-weight: 800;
    }
    @keyframes pulse-orders {
        0%, 100% { box-shadow: 0 4px 18px rgba(0,255,127,0.4); }
        50% { box-shadow: 0 4px 30px rgba(0,255,127,0.7); }
    }
    .my-orders-panel {
        position: fixed; bottom: 0; left: 0; right: 0;
        z-index: 5001; background: var(--surface);
        border-top-left-radius: 20px; border-top-right-radius: 20px;
        max-height: 70vh; overflow-y: auto;
        transform: translateY(100%); transition: transform 0.3s ease;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    }
    .my-orders-panel.open { transform: translateY(0); }
    .my-orders-panel-header {
        display: flex; align-items: center; justify-content: space-between;
        padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
        position: sticky; top: 0; background: var(--surface); z-index: 1;
    }
    [data-theme="light"] .my-orders-float-btn { background: rgba(59,130,246,0.1); border-color: #3b82f6; color: #3b82f6; }
    [data-theme="light"] .my-orders-float-btn.has-orders { background: rgba(0,184,94,0.1); border-color: #00b85e; color: #00b85e; }
    [data-theme="light"] .my-orders-panel { background: #fff; box-shadow: 0 -10px 40px rgba(0,0,0,0.15); }
    [data-theme="light"] .my-orders-panel-header { border-bottom-color: #eee; }
    [data-theme="light"] .svc-modal-card { background: #fff; }
    [data-theme="light"] .svc-type-card { background: #f5f5f5; border-color: #ddd; }
    [data-theme="light"] .svc-type-card.selected { border-color: #00b85e; background: rgba(0,184,94,0.08); }
    [data-theme="light"] .svc-input-group input, [data-theme="light"] .svc-input-group select { background: #f0f0f0; border-color: #ccc; color: #333; }
    [data-theme="light"] .svc-input-group input:focus { border-color: #00b85e; }
    [data-theme="light"] #incoming-ride-popup { background: #fff; border-color: #00b85e; }
    [data-theme="light"] .zones-display { background: rgba(0,180,94,0.08); }
    [data-theme="light"] .rating-display { background: rgba(255,204,0,0.08); }
    [data-theme="light"] .payment-info-box { background: rgba(255,204,0,0.08); }
    [data-theme="light"] .price-negotiation { background: rgba(255,204,0,0.06); }
    [data-theme="light"] .loading-markers { background: rgba(255,255,255,0.9); color: #333; }
    [data-theme="light"] .modal-overlay { background: rgba(255,255,255,0.7); }
    [data-theme="light"] .badge { border-color: #fff; }

    /* Smooth theme transitions */
    body, #app-header, .modal-card, .chat-header, .ride-panel,
    .snackbar, #users-drawer, .lobby-card, .profile-card-header,
    .action-btn, .btn-profile, .msg-other, .chat-body, .chat-input-area {
        transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    }

    /* === FAVORITOS CHIPS === */
    .fav-chips-container {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 12px;
    }
    .fav-chip {
        background: rgba(0,255,127,0.1);
        border: 1px solid var(--primary);
        color: var(--primary);
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 0.8rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
        transition: background 0.2s;
        white-space: nowrap;
    }
    .fav-chip:hover { background: rgba(0,255,127,0.2); }
    .fav-chip i { font-size: 0.75rem; }

    /* === RANKING MODAL === */
    .ranking-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        border-bottom: 1px solid #333;
        cursor: pointer;
        transition: background 0.2s;
    }
    .ranking-item:hover { background: rgba(255,255,255,0.05); }
    .ranking-position {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: bold;
        font-size: 0.9rem;
        flex-shrink: 0;
        background: #333;
        color: #888;
    }
    .ranking-position.gold { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; box-shadow: 0 0 10px rgba(255,215,0,0.5); }
    .ranking-position.silver { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; box-shadow: 0 0 8px rgba(192,192,192,0.4); }
    .ranking-position.bronze { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; box-shadow: 0 0 8px rgba(205,127,50,0.4); }
    .ranking-info { flex: 1; min-width: 0; }
    .ranking-name { font-weight: bold; font-size: 0.9rem; }
    .ranking-meta { font-size: 0.75rem; color: #888; display: flex; gap: 10px; align-items: center; margin-top: 2px; }
    .ranking-stars { color: gold; font-size: 0.8rem; }
    .ranking-rides { color: #aaa; font-size: 0.75rem; }
    .ranking-badge-item {
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.65rem;
        font-weight: bold;
        background: rgba(0,255,127,0.15);
        color: var(--primary);
    }

    /* === GPS TRACKING - PULSE MARKER === */
    .driver-pulse-marker {
        position: relative;
    }
    .driver-pulse-circle {
        position: absolute;
        top: 50%; left: 50%;
        transform: translate(-50%, -50%);
        width: 50px; height: 50px;
        border-radius: 50%;
        background: rgba(0,255,127,0.2);
        animation: pulseGps 2s ease-out infinite;
        pointer-events: none;
    }
    @keyframes pulseGps {
        0% { transform: translate(-50%,-50%) scale(0.5); opacity: 1; }
        100% { transform: translate(-50%,-50%) scale(2); opacity: 0; }
    }
    .gps-line {
        stroke-dasharray: 10, 10;
        animation: dashMove 1s linear infinite;
    }
    @keyframes dashMove {
        to { stroke-dashoffset: -20; }
    }

    /* === ESTIMATED ARRIVAL === */
    .arrival-estimate {
        text-align: center;
        padding: 10px;
        background: rgba(0,255,127,0.08);
        border: 1px solid rgba(0,255,127,0.2);
        border-radius: 10px;
        margin: 8px 0;
        animation: fadeIn 0.5s ease;
    }
    .arrival-estimate i { color: var(--primary); margin-right: 5px; }
    .arrival-time { font-size: 1.3rem; font-weight: bold; color: var(--primary); }
    .arrival-label { font-size: 0.8rem; color: #aaa; margin-top: 2px; }

    /* === SCHEDULE TRIP TOGGLE === */
    .schedule-toggle {
        display: flex;
        background: #1a1a1a;
        border-radius: 10px;
        overflow: hidden;
        margin-bottom: 15px;
        border: 1px solid #333;
    }
    .schedule-toggle-btn {
        flex: 1;
        padding: 10px;
        text-align: center;
        cursor: pointer;
        font-size: 0.85rem;
        font-weight: bold;
        transition: all 0.3s;
        color: #888;
        border: none;
        background: transparent;
    }
    .schedule-toggle-btn.active {
        background: var(--primary);
        color: #000;
    }
    .schedule-datetime {
        display: none;
        animation: slideUpAuth 0.3s ease-out;
    }
    .schedule-datetime.visible { display: block; }

    /* === INTERMEDIATE STOPS === */
    .stops-list {
        margin: 10px 0;
    }
    .stop-item {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        animation: slideUpAuth 0.3s ease-out;
    }
    .stop-item input {
        flex: 1;
        padding: 10px;
        background: #1a1a1a;
        border: 1px solid #444;
        color: white;
        border-radius: 8px;
        font-size: 0.85rem;
    }
    .stop-item input:focus { outline: none; border-color: var(--primary); }
    .stop-remove-btn {
        background: var(--danger);
        border: none;
        color: white;
        width: 30px; height: 30px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 0.8rem;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }
    .add-stop-btn {
        background: transparent;
        border: 1px dashed #444;
        color: #888;
        padding: 8px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.8rem;
        width: 100%;
        text-align: center;
        transition: all 0.2s;
    }
    .add-stop-btn:hover { border-color: var(--primary); color: var(--primary); }

    /* === SHARE RIDE === */
    .share-ride-btn {
        display: none;
    }
    .share-ride-btn:hover { opacity: 0.9; }

    /* === COUPONS === */
    .coupon-input-row {
        display: flex;
        gap: 8px;
        margin: 10px 0;
    }
    .coupon-input {
        flex: 1;
        padding: 10px;
        background: #1a1a1a;
        border: 1px solid var(--service);
        color: white;
        border-radius: 8px;
        font-size: 0.9rem;
        text-transform: uppercase;
    }
    .coupon-input:focus { outline: none; border-color: var(--primary); }
    .coupon-list { margin-top: 10px; }
    .coupon-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
        background: rgba(255,204,0,0.05);
        border: 1px solid #333;
        border-radius: 8px;
        margin-bottom: 8px;
    }
    .coupon-code { font-weight: bold; color: var(--service); font-family: monospace; font-size: 0.9rem; }
    .coupon-desc { font-size: 0.75rem; color: #888; }
    .coupon-used { text-decoration: line-through; opacity: 0.5; }

    /* === REFERRAL === */
    .referral-section {
        background: rgba(0,255,127,0.05);
        border: 1px solid rgba(0,255,127,0.2);
        border-radius: 10px;
        padding: 15px;
        margin: 10px 0;
        text-align: center;
    }
    .referral-code {
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--primary);
        letter-spacing: 3px;
        font-family: monospace;
        background: rgba(0,0,0,0.3);
        padding: 10px 20px;
        border-radius: 8px;
        display: inline-block;
        margin: 10px 0;
    }
    .referral-count {
        font-size: 0.85rem;
        color: #aaa;
        margin-top: 5px;
    }

    /* === NOTIFICATION SETTINGS === */
    .notification-toggle-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #333;
    }
    .toggle-switch {
        position: relative;
        width: 44px;
        height: 24px;
        background: #444;
        border-radius: 12px;
        cursor: pointer;
        transition: background 0.3s;
    }
    .toggle-switch.active { background: var(--primary); }
    .toggle-switch::after {
        content: '';
        position: absolute;
        top: 2px; left: 2px;
        width: 20px; height: 20px;
        background: white;
        border-radius: 50%;
        transition: transform 0.3s;
    }
    .toggle-switch.active::after { transform: translateX(20px); }

    /* === ENHANCED DRIVER STATS === */
    .stats-enhanced-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 10px 0;
    }
    .stat-enhanced-item {
        background: rgba(0,0,0,0.3);
        padding: 10px;
        border-radius: 8px;
        text-align: center;
    }
    .stat-enhanced-value {
        font-size: 1.1rem;
        font-weight: bold;
        color: var(--primary);
    }
    .stat-enhanced-label {
        font-size: 0.65rem;
        color: #888;
        text-transform: uppercase;
    }
    .rating-breakdown-bar {
        margin: 8px 0;
    }
    .rating-bar-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }
    .rating-bar-label {
        font-size: 0.7rem;
        color: #aaa;
        width: 80px;
        text-align: right;
        flex-shrink: 0;
    }
    .rating-bar-track {
        flex: 1;
        height: 8px;
        background: #333;
        border-radius: 4px;
        overflow: hidden;
    }
    .rating-bar-fill {
        height: 100%;
        border-radius: 4px;
        background: linear-gradient(90deg, var(--primary), var(--service));
        transition: width 0.5s ease;
    }
    .rating-bar-val {
        font-size: 0.7rem;
        color: #ccc;
        width: 30px;
        flex-shrink: 0;
    }

    /* === CHAT IMAGE === */
    .msg-image {
        max-width: 200px;
        border-radius: 10px;
        cursor: pointer;
        transition: opacity 0.2s;
    }
    .msg-image:hover { opacity: 0.85; }
    .image-fullscreen-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.95);
        z-index: 10000;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }
    .image-fullscreen-overlay img {
        max-width: 95%;
        max-height: 95%;
        object-fit: contain;
    }
    .chat-media-btns {
        display: flex;
        gap: 5px;
        align-items: center;
    }
    .chat-media-btn {
        background: none;
        border: none;
        color: #888;
        font-size: 1.1rem;
        cursor: pointer;
        padding: 5px;
        border-radius: 50%;
        transition: color 0.2s;
    }
    .chat-media-btn:hover { color: var(--primary); }

    /* === SCHEDULED RIDES LIST === */
    .scheduled-ride-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background: rgba(0,0,0,0.3);
        border: 1px solid #333;
        border-radius: 10px;
        margin-bottom: 8px;
    }
    .scheduled-ride-info { flex: 1; }
    .scheduled-ride-time { font-weight: bold; color: var(--service); font-size: 0.85rem; }
    .scheduled-ride-route { font-size: 0.8rem; color: #aaa; margin-top: 2px; }
    .scheduled-ride-cancel {
        background: var(--danger);
        border: none;
        color: white;
        padding: 5px 10px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.75rem;
    }

    /* === FAVORITES LIST IN PROFILE === */
    .favorite-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        background: rgba(0,0,0,0.2);
        border: 1px solid #333;
        border-radius: 10px;
        margin-bottom: 8px;
    }
    .favorite-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(0,255,127,0.1);
        display: flex;
        justify-content: center;
        align-items: center;
        color: var(--primary);
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    .favorite-info { flex: 1; min-width: 0; }
    .favorite-name { font-weight: bold; font-size: 0.9rem; }
    .favorite-address { font-size: 0.75rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .favorite-delete {
        background: none;
        border: none;
        color: var(--danger);
        cursor: pointer;
        font-size: 1rem;
        padding: 5px;
    }
    .add-favorite-form {
        display: flex;
        gap: 8px;
        margin-bottom: 15px;
    }
    .add-favorite-form input {
        flex: 1;
        padding: 10px;
        background: #1a1a1a;
        border: 1px solid #444;
        color: white;
        border-radius: 8px;
        font-size: 0.85rem;
    }
    .add-favorite-form input:focus { outline: none; border-color: var(--primary); }

    /* ==============================
       ALLIANCE SYSTEM - CSS
       ============================== */
    .alliance-modal-content {
        background: var(--surface);
        width: 100%;
        max-width: 500px;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
        border-top: 2px solid #a855f7;
        animation: slideUp 0.3s;
        overflow: hidden;
    }
    .alliance-modal-header {
        padding: 15px;
        background: var(--surface-light);
        border-bottom: 1px solid #333;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }
    .alliance-modal-header h3 { font-size: 1rem; }
    .alliance-modal-header .close-btn {
        background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer;
    }
    .alliance-tabs {
        display: flex;
        border-bottom: 2px solid #333;
        background: rgba(0,0,0,0.2);
        flex-shrink: 0;
        overflow-x: auto;
    }
    .alliance-tab {
        flex: 1;
        padding: 12px 6px;
        text-align: center;
        cursor: pointer;
        font-size: 0.75rem;
        font-weight: bold;
        color: #888;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
        transition: all 0.2s;
        text-transform: uppercase;
        white-space: nowrap;
    }
    .alliance-tab.active {
        color: #a855f7;
        border-bottom-color: #a855f7;
    }
    .alliance-tab:hover { color: #ccc; }
    .alliance-tab-content {
        display: none;
        flex: 1;
        overflow-y: auto;
        padding: 15px;
    }
    .alliance-tab-content.active {
        display: flex;
        flex-direction: column;
    }
    .alliance-list-item {
        background: #222;
        border: 1px solid #333;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 10px;
        cursor: pointer;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .alliance-list-item:hover { background: #2a2a2a; }
    .alliance-list-item .alliance-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.4rem;
        flex-shrink: 0;
        overflow: hidden;
    }
    .alliance-list-item .alliance-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 12px;
    }
    .alliance-list-item .alliance-info { flex: 1; min-width: 0; }
    .alliance-list-item .alliance-name { font-weight: bold; font-size: 0.9rem; }
    .alliance-list-item .alliance-desc { font-size: 0.75rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .alliance-list-item .alliance-meta { font-size: 0.7rem; color: #666; margin-top: 2px; }
    .alliance-profile-view {
        padding: 15px;
        text-align: center;
    }
    .alliance-profile-view .alliance-logo-big {
        width: 80px;
        height: 80px;
        border-radius: 20px;
        margin: 0 auto 12px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 2rem;
        overflow: hidden;
        border: 3px solid #a855f7;
    }
    .alliance-profile-view .alliance-logo-big img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .alliance-profile-view .alliance-title { font-size: 1.3rem; font-weight: bold; }
    .alliance-profile-view .alliance-desc-full { font-size: 0.85rem; color: #aaa; margin-top: 6px; }
    .alliance-profile-view .alliance-stats-row {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 12px;
    }
    .alliance-profile-view .alliance-stat {
        text-align: center;
        padding: 8px 14px;
        background: rgba(0,0,0,0.3);
        border-radius: 10px;
    }
    .alliance-profile-view .alliance-stat-val { font-size: 1.1rem; font-weight: bold; color: #a855f7; }
    .alliance-profile-view .alliance-stat-label { font-size: 0.65rem; color: #888; text-transform: uppercase; }
    .alliance-member-row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        border-bottom: 1px solid #333;
    }
    .alliance-member-row .member-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #333;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        overflow: hidden;
    }
    .alliance-member-row .member-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }
    .alliance-member-row .member-info { flex: 1; min-width: 0; }
    .alliance-member-row .member-name { font-size: 0.85rem; font-weight: bold; }
    .alliance-member-row .member-role-label { font-size: 0.7rem; color: #a855f7; }
    .alliance-member-row .member-actions button {
        background: #333;
        border: 1px solid #444;
        color: white;
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 0.75rem;
        cursor: pointer;
        margin-left: 5px;
    }
    .alliance-chat-area {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-height: 200px;
        background: #181818;
    }
    .alliance-msg {
        max-width: 80%;
        padding: 8px 12px;
        border-radius: 12px;
        font-size: 0.85rem;
        line-height: 1.3;
        word-wrap: break-word;
    }
    .alliance-msg.own {
        align-self: flex-end;
        background: #a855f7;
        color: white;
        border-bottom-right-radius: 2px;
    }
    .alliance-msg.other {
        align-self: flex-start;
        background: #333;
        color: white;
        border-bottom-left-radius: 2px;
    }
    .alliance-msg .msg-sender { font-size: 0.7rem; color: #a855f7; font-weight: bold; margin-bottom: 2px; }
    .alliance-msg .msg-time { font-size: 0.6rem; color: #888; margin-top: 3px; text-align: right; }
    .alliance-chat-input {
        display: flex;
        gap: 8px;
        padding: 10px;
        border-top: 1px solid #333;
        background: var(--surface-light);
        flex-shrink: 0;
    }
    .alliance-chat-input input {
        flex: 1;
        padding: 10px 14px;
        background: #252525;
        border: 1px solid #444;
        color: white;
        border-radius: 20px;
        font-size: 0.85rem;
        outline: none;
    }
    .alliance-chat-input input:focus { border-color: #a855f7; }
    .alliance-chat-input button {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #a855f7;
        color: white;
        border: none;
        cursor: pointer;
        font-size: 0.9rem;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }
    .alliance-color-circle {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        cursor: pointer;
        border: 3px solid transparent;
        transition: transform 0.2s, border-color 0.2s;
    }
    .alliance-color-circle:hover { transform: scale(1.1); }
    .alliance-color-circle.selected { border-color: white; transform: scale(1.15); box-shadow: 0 0 12px rgba(255,255,255,0.3); }
    .pending-request-card {
        background: rgba(168, 85, 247, 0.1);
        border: 1px solid rgba(168, 85, 247, 0.3);
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .pending-request-card .req-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #333;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        overflow: hidden;
    }
    .pending-request-card .req-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }
    .pending-request-card .req-info { flex: 1; min-width: 0; }
    .pending-request-card .req-name { font-weight: bold; font-size: 0.85rem; }
    .pending-request-card .req-date { font-size: 0.7rem; color: #888; }
    .pending-request-card .req-actions { display: flex; gap: 6px; }
    .pending-request-card .req-actions button {
        padding: 6px 12px;
        border: none;
        border-radius: 6px;
        font-size: 0.75rem;
        font-weight: bold;
        cursor: pointer;
    }
    .btn-approve { background: var(--primary); color: black; }
    .btn-reject { background: var(--danger); color: white; }
    .alliance-chat-subtabs {
        display: flex;
        gap: 4px;
        padding: 8px 15px;
        background: rgba(0,0,0,0.2);
        flex-shrink: 0;
    }
    .alliance-chat-subtab {
        flex: 1;
        padding: 8px;
        text-align: center;
        border-radius: 8px;
        font-size: 0.75rem;
        font-weight: bold;
        cursor: pointer;
        color: #888;
        background: transparent;
        border: none;
        transition: all 0.2s;
    }
    .alliance-chat-subtab.active {
        background: rgba(168,85,247,0.2);
        color: #a855f7;
    }
    .alliance-no-data {
        text-align: center;
        padding: 30px 20px;
        color: #666;
    }
    .alliance-no-data i {
        font-size: 2.5rem;
        display: block;
        margin-bottom: 10px;
        color: #444;
    }
    .btn-alliance-action {
        width: 100%;
        padding: 12px;
        border: none;
        border-radius: 10px;
        font-weight: bold;
        cursor: pointer;
        font-size: 0.85rem;
        margin-top: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    .btn-join-alliance {
        background: #a855f7;
        color: white;
    }
    .btn-leave-alliance {
        background: transparent;
        border: 1px solid var(--danger) !important;
        color: var(--danger);
    }
    .btn-create-alliance {
        background: linear-gradient(135deg, #a855f7, #6d28d9);
        color: white;
    }
    .create-alliance-form { padding: 15px; }
    .create-alliance-form .input-group { margin-bottom: 15px; }
    .create-alliance-form .input-group input,
    .create-alliance-form .input-group textarea {
        width: 100%;
        padding: 12px;
        background: #1a1a1a;
        border: 1px solid #444;
        color: white;
        border-radius: 8px;
        font-size: 0.85rem;
        outline: none;
    }
    .create-alliance-form .input-group input:focus,
    .create-alliance-form .input-group textarea:focus {
        border-color: #a855f7;
    }
    .create-alliance-form .input-group label {
        display: block;
        margin-bottom: 6px;
        color: #aaa;
        font-size: 0.8rem;
        font-weight: bold;
    }
    .color-picker-grid {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 6px;
    }
    .logo-upload-area {
        border: 2px dashed #444;
        border-radius: 12px;
        padding: 20px;
        text-align: center;
        cursor: pointer;
        transition: border-color 0.2s;
        margin-top: 6px;
    }
    .logo-upload-area:hover { border-color: #a855f7; }
    .logo-upload-area i { font-size: 1.5rem; color: #666; margin-bottom: 6px; }
    .logo-upload-area p { font-size: 0.75rem; color: #888; }
    .logo-upload-preview {
        width: 60px;
        height: 60px;
        border-radius: 12px;
        margin: 10px auto 0;
        display: none;
        overflow: hidden;
        border: 2px solid #a855f7;
    }
    .logo-upload-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .alliance-empty-state {
        text-align: center;
        padding: 40px 20px;
    }
    .alliance-empty-state i {
        font-size: 3rem;
        color: #333;
        margin-bottom: 12px;
    }
    .alliance-empty-state p {
        color: #888;
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    .alliance-back-btn {
        background: #333;
        border: 1px solid #444;
        color: white;
        padding: 8px 16px;
        border-radius: 8px;
        font-size: 0.8rem;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 15px;
    }
    .alliance-back-btn:hover { background: #444; }
    .members-header {
        padding: 10px 15px;
        font-size: 0.8rem;
        font-weight: bold;
        color: #888;
        text-transform: uppercase;
        border-bottom: 1px solid #333;
        background: rgba(0,0,0,0.2);
    }

    /* Map selector and autocomplete */
    .map-selector-container { height: 200px; border-radius: 12px; overflow: hidden; border: 2px solid #333; margin: 10px 0; position: relative; }
    .map-selector-hint { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px 10px; font-size: 0.75rem; text-align: center; z-index: 1000; pointer-events: none; }
    .map-selector-hint.origin-mode { background: rgba(0,184,94,0.8); color: white; }
    .map-selector-hint.dest-mode { background: rgba(255,0,85,0.8); color: white; }
    .autocomplete-dropdown { position: absolute; background: #1a1a1a; border: 1px solid #444; border-radius: 8px; max-height: 200px; overflow-y: auto; z-index: 10001; width: calc(100% - 24px); display: none; }
    .route-info-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 15px; font-size: 0.75rem; font-weight: 700; }
    .route-info-badge.distance { background: rgba(255,215,0,0.15); color: #ffd700; border: 1px solid rgba(255,215,0,0.3); }
    .route-info-badge.duration { background: rgba(0,184,94,0.15); color: #00b85e; border: 1px solid rgba(0,184,94,0.3); }
    .mini-map-container { height: 180px; border-radius: 10px; overflow: hidden; border: 1px solid #333; margin: 8px 0; }
    .view-fullmap-btn { width: 100%; padding: 8px; background: linear-gradient(135deg, #ffd700, #ffaa00); color: #000; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.8rem; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
    .lobby-mini-map { height: 180px; border-radius: 10px; overflow: hidden; margin: 8px 0; border: 1px solid #333; }
    [data-theme="light"] .autocomplete-dropdown { background: #fff; border-color: #ddd; }
    [data-theme="light"] .map-selector-container { border-color: #ddd; }
    [data-theme="light"] .mini-map-container { border-color: #ddd; }

    


    /* =====================================================
       FASE 2: FLUJO DE CARRERA (llegada, PIN, cancelación, compartir, SOS)
       ===================================================== */
    .ride-stage-msg { text-align: center; padding: 8px; color: var(--primary); font-weight: 600; font-size: .9rem; }
    .ride-stage-msg i { margin-right: 6px; }
    .ride-stage-arrived { color: var(--service); font-size: 1rem; }
    .ride-stage-warn {
        background: rgba(255,204,0,0.1); border: 1px solid rgba(255,204,0,0.35); color: var(--service);
        border-radius: 10px; padding: 8px 10px; margin: 6px 0 8px; font-size: .78rem; line-height: 1.35;
    }
    .ride-stage-warn i { margin-right: 5px; }
    .ride-pin-box {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        background: rgba(0,255,127,0.08); border: 2px dashed var(--primary); border-radius: 12px;
        padding: 10px; margin: 8px 0;
    }
    .ride-pin-label { font-size: .72rem; color: var(--text-sec); text-transform: uppercase; letter-spacing: .05em; }
    .ride-pin-value { font-size: 2rem; letter-spacing: .4em; color: var(--primary); font-weight: 900; padding-left: .4em; }
    .ride-pin-box small { font-size: .7rem; color: var(--text-sec); text-align: center; }
    .ride-pin-entry { display: flex; gap: 8px; align-items: stretch; margin: 6px 0; }
    .ride-pin-entry input {
        width: 110px; flex-shrink: 0; padding: 10px; background: #252525; border: 2px solid var(--service);
        color: #fff; border-radius: 8px; font-size: 1.4rem; font-weight: 800; letter-spacing: .3em; text-align: center;
    }
    .ride-pin-entry .btn-ride { margin-bottom: 0; }
    .ride-pin-error { color: var(--danger); font-size: .78rem; min-height: 1em; text-align: center; margin-bottom: 4px; }
    .ride-btn-map { background: #333; color: var(--primary); border: 1px solid var(--primary); }
    .ride-safety-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 6px 0 8px; }
    .ride-safety-row:has(> :only-child) { grid-template-columns: 1fr; }
    .ride-safety-row .share-ride-btn {
        display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px;
        background: rgba(74,158,255,0.15); color: #4a9eff; border: 1px solid #4a9eff; border-radius: 8px;
        font-weight: 700; cursor: pointer; font-size: .85rem;
    }
    .ride-sos-btn {
        display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px;
        background: var(--danger); color: #fff; border: none; border-radius: 8px; font-weight: 900;
        cursor: pointer; font-size: .85rem; box-shadow: 0 0 12px rgba(255,0,85,0.4);
    }

    /* Diálogo de cancelación */
    .cancel-ride-card { max-width: 400px; margin: auto; padding: 20px; }
    .cancel-ride-card h3 { margin-bottom: 4px; }
    .cancel-ride-sub { color: var(--text-sec); font-size: .82rem; margin-bottom: 10px; }
    .cancel-reason-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
    .cancel-reason {
        display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #333; border-radius: 8px;
        cursor: pointer; font-size: .88rem;
    }
    .cancel-reason:has(input:checked) { border-color: var(--danger); background: rgba(255,0,85,0.08); }
    #cancel-ride-note {
        width: 100%; padding: 10px; background: #1a1a1a; border: 1px solid #444; color: #fff; border-radius: 8px;
        font-family: inherit; font-size: .85rem; resize: vertical; margin-bottom: 6px;
    }
    .cancel-ride-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

    /* Barra flotante de carrera en curso */
    .active-ride-bar {
        position: fixed; left: 50%; transform: translateX(-50%); top: 72px; z-index: 1500;
        width: calc(100% - 24px); max-width: 520px; display: none; align-items: center; gap: 8px;
        background: var(--surface); border: 1px solid var(--primary); border-radius: 14px;
        padding: 8px 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    }
    .active-ride-bar.visible { display: flex; }
    /* Con carrera en curso: el botón "Solicitar Servicio" tapaba la barra (y el PIN) */
    body.has-active-ride #request-service-float { display: none !important; }
    /* El conductor conserva su botón Conectado/Desconectado (top 68px): la barra va debajo */
    .active-ride-bar.arb-driver { top: 124px; }
    .arb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
    .arb-status { font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--primary); }
    .arb-status.arb-arrived { color: var(--service); }
    .arb-status.arb-active { color: #a855f7; }
    .arb-status.arb-pending { color: var(--warning, #f5a623); }
    .arb-who { font-size: .88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .arb-vehicle { font-size: .72rem; color: var(--text-sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .arb-pin {
        font-weight: 900; color: var(--primary); letter-spacing: .15em; font-size: 1rem;
        background: rgba(0,255,127,0.1); border-radius: 8px; padding: 4px 8px; white-space: nowrap;
    }
    .arb-actions { display: flex; gap: 6px; }
    .arb-btn {
        width: 36px; height: 36px; border-radius: 50%; border: 1px solid #444; background: #252525;
        color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
    }
    .arb-btn.arb-sos { background: var(--danger); border-color: var(--danger); color: #fff; }
    [data-theme="light"] .active-ride-bar { background: #fff; }
    [data-theme="light"] .arb-btn { background: #f0f0f0; border-color: #ddd; }
    [data-theme="light"] .ride-pin-entry input,
    [data-theme="light"] #cancel-ride-note { background: #f0f0f0; color: #1a1a1a; border-color: #ccc; }
    [data-theme="light"] .cancel-reason { border-color: #ddd; }
