
        :root {
            /* Paleta Comunidad y Confianza: Verde Azulado (Serenidad) y Naranja Cálido */
            --primary: #0f766e;
            --primary-light: rgba(15, 118, 110, 0.1);
            --primary-glow: rgba(15, 118, 110, 0.2);
            --accent: #ea580c;
            --accent-glow: rgba(234, 88, 12, 0.2);
            --bg-app: #f1f5f9;
            --sidebar-width: 280px;
            --glass-bg: rgba(255, 255, 255, 0.9);
            --glass-border: rgba(226, 232, 240, 0.8);
            --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
            --shadow-hover: 0 10px 25px -2px rgba(15, 23, 42, 0.08);
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-app);
            background-image:
                radial-gradient(at 0% 0%, hsla(160, 100%, 98%, 1) 0px, transparent 50%),
                radial-gradient(at 100% 100%, hsla(200, 100%, 96%, 1) 0px, transparent 50%);
            background-attachment: fixed;
            margin: 0;
            height: 100vh;
            height: 100dvh;
            overflow: hidden;
            transition: all 0.3s ease;
            color: #334155;
        }

        /* --- SCROLLBAR MODERNO Y SUTIL --- */
        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(203, 213, 225, 0.8);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 1);
        }

        /* --- UI ELEMENTS --- */
        #auth-screen {
            position: fixed;
            inset: 0;
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            padding: 40px 24px;
            overflow-y: auto;
        }

        #main-app-shell {
            display: none;
            width: 100%;
            height: 100vh;
            height: 100dvh;
            position: relative;
            background: transparent;
            overflow: hidden;
        }

        /* Menú lateral limpio y sólido */
        .sidebar {
            width: var(--sidebar-width);
            background: #ffffff;
            height: 100vh;
            height: 100dvh;
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--glass-border);
            transition: transform 0.3s ease;
            overflow-y: auto;
            box-shadow: 4px 0 20px rgba(0, 0, 0, 0.02);
        }

        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                left: 0;
                top: 0;
                transform: translateX(-100%);
                z-index: 1050;
                box-shadow: 4px 0 25px rgba(0, 0, 0, 0.1);
                padding-bottom: env(safe-area-inset-bottom, 24px);
            }

            .sidebar.open {
                transform: translateX(0);
            }
        }

        #sidebar-overlay {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.4);
            display: none;
            z-index: 1045;
            backdrop-filter: blur(2px);
        }

        #sidebar-overlay.visible {
            display: block;
            animation: fadeIn 0.2s ease;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            border-radius: 10px;
            color: #475569;
            font-weight: 500;
            cursor: pointer;
            margin-bottom: 4px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-size: 0.95rem;
        }

        .nav-item:hover {
            background-color: #f1f5f9;
            color: var(--primary);
            transform: translateX(6px);
        }

        .nav-item svg {
            width: 20px;
            height: 20px;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .nav-item:hover svg {
            transform: scale(1.15) rotate(-5deg);
        }

        .nav-item.active {
            background-color: var(--primary-light);
            color: var(--primary);
            font-weight: 600;
        }

        .main-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow: hidden;
            position: relative;
        }

        .app-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            padding: 24px;
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
            min-height: 0;
        }

        @media (max-width: 768px) {
            .app-main {
                padding: 12px;
                padding-bottom: 16px;
            }

            #normal-mobile-topbar {
                background: #ffffff !important;
                border-bottom: 1px solid var(--glass-border);
            }

            input,
            select,
            textarea {
                font-size: 16px !important;
            }
        }

        .hide-scrollbar::-webkit-scrollbar {
            display: none;
        }

        .hide-scrollbar {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        /* Tarjetas legibles y elegantes */
        .app-card {
            background: #ffffff;
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 20px;
            border: 1px solid var(--glass-border);
            transition: all 0.3s ease;
            box-shadow: var(--shadow-soft);
        }

        .app-card:not(.static-card):hover {
            box-shadow: var(--shadow-hover);
            transform: translateY(-2px);
        }

        /* --- PANEL DE BIENVENIDA PREMIUM --- */
        .welcome-panel {
            background: linear-gradient(135deg, var(--primary) 0%, #14b8a6 100%) !important;
            border: 1px solid rgba(255, 255, 255, 0.2) !important;
            box-shadow: 0 10px 30px -5px rgba(15, 118, 110, 0.3) !important;
            color: white !important;
        }

        .welcome-panel-pattern {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
            opacity: 0.6;
            pointer-events: none;
        }

        /* Inputs limpios */
        input,
        select,
        textarea {
            box-sizing: border-box !important;
            max-width: 100% !important;
            background-color: #f8fafc !important;
            border: 1px solid #cbd5e1 !important;
            border-radius: 10px !important;
            padding: 12px 14px !important;
            width: 100%;
            outline: none !important;
            font-size: 0.95rem;
            color: #334155;
            transition: all 0.2s ease;
            caret-color: var(--primary);
        }

        input[type="date"],
        input[type="time"] {
            -webkit-appearance: none !important;
            appearance: none !important;
            min-width: 0 !important;
            padding: 12px 14px !important;
            width: 100% !important;
            max-width: 100% !important;
            height: 46px !important;
            line-height: normal !important;
        }

        /* --- MODO OSCURO (Overrides Globales) --- */
        html.dark body {
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
            color: #f8fafc !important;
        }

        html.dark .app-main {
            background-color: #0f172a !important;
        }

        html.dark .app-card,
        html.dark .bg-white {
            background-color: #1e293b !important;
            border-color: #334155 !important;
        }

        html.dark .text-slate-800,
        html.dark .text-slate-700,
        html.dark .text-slate-600 {
            color: #f8fafc !important;
        }

        html.dark .text-slate-500,
        html.dark .text-gray-500 {
            color: #94a3b8 !important;
        }

        html.dark .bg-slate-50,
        html.dark .bg-slate-100,
        html.dark .bg-slate-200 {
            background-color: #0f172a !important;
            border-color: #334155 !important;
        }

        html.dark .border-slate-100,
        html.dark .border-slate-200,
        html.dark .border-slate-300 {
            border-color: #334155 !important;
        }

        html.dark input,
        html.dark select,
        html.dark textarea {
            background-color: #0f172a !important;
            color: #f8fafc !important;
            border-color: #334155 !important;
        }

        html.dark .nav-item:not(.active) {
            color: #94a3b8 !important;
        }

        html.dark .nav-item.active {
            background-color: #3b82f6 !important;
            color: white !important;
        }

        html.dark .nav-item:hover:not(.active) {
            background-color: #334155 !important;
            color: #f8fafc !important;
        }

        html.dark aside,
        html.dark #desktop-sidebar {
            background-color: #1e293b !important;
            border-color: #334155 !important;
        }

        html.dark .topbar,
        html.dark #normal-mobile-topbar {
            background-color: #1e293b !important;
            border-color: #334155 !important;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5) !important;
        }

        html.dark #normal-mobile-topbar h1 {
            color: #60a5fa !important;
        }

        input:hover,
        select:hover,
        textarea:hover {
            border-color: #94a3b8 !important;
        }

        input:focus,
        select:focus,
        textarea:focus,
        input:focus-visible,
        select:focus-visible,
        textarea:focus-visible {
            outline: none !important;
            border-color: var(--primary) !important;
            box-shadow: 0 0 0 3px var(--primary-light) !important;
            background-color: #ffffff !important;
        }

        html.dark input:focus,
        html.dark select:focus,
        html.dark textarea:focus,
        html.dark input:focus-visible,
        html.dark select:focus-visible,
        html.dark textarea:focus-visible {
            background-color: #0f172a !important;
            color: #f8fafc !important;
            border-color: #14b8a6 !important;
            box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15) !important;
        }

        /* --- ESTILOS ESPECÍFICOS DEL CHAT Y MODO OSCURO --- */
        #chat-input,
        #chat-input:hover,
        #chat-input:focus,
        #chat-input:focus-visible,
        html.dark #chat-input,
        html.dark #chat-input:hover,
        html.dark #chat-input:focus,
        html.dark #chat-input:focus-visible {
            background-color: transparent !important;
            border: none !important;
            box-shadow: none !important;
        }

        html.dark #chat-header,
        html.dark #chat-input-bar {
            background-color: rgba(30, 41, 59, 0.95) !important;
            border-color: #334155 !important;
        }

        html.dark #chat-messages {
            background-color: #0f172a !important;
        }

        html.dark #chat-input-wrapper {
            background-color: #0f172a !important;
            border-color: #334155 !important;
        }

        html.dark #chat-input-wrapper:focus-within {
            border-color: #14b8a6 !important;
            box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15) !important;
        }

        html.dark #chat-list > div:hover {
            background-color: rgba(51, 65, 85, 0.4) !important;
        }

        html.dark #chat-video-call-btn {
            background-color: rgba(20, 184, 166, 0.15) !important;
            color: #2dd4bf !important;
        }

        html.dark #chat-header .bg-red-50,
        html.dark #chat-list .bg-red-50 {
            background-color: rgba(239, 68, 68, 0.15) !important;
            color: #f87171 !important;
        }

        /* Botones de acción sobrios y claros */
        .btn-action {
            background-color: var(--primary);
            color: white;
            padding: 14px;
            border-radius: 10px;
            font-weight: 600;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            border: none;
            transition: all 0.2s ease;
            box-shadow: 0 4px 6px var(--primary-glow);
        }

        .btn-action:hover {
            background-color: #115e59;
            transform: translateY(-1px);
            box-shadow: 0 6px 12px var(--primary-glow);
        }

        .btn-action:active {
            transform: translateY(1px);
            box-shadow: 0 2px 4px var(--primary-glow);
        }

        /* --- OVERRIDES PARA CLASES TAILWIND --- */
        .text-blue-600,
        .text-blue-700 {
            color: var(--primary) !important;
        }

        .bg-blue-600 {
            background-color: var(--primary) !important;
            border: none !important;
            color: white !important;
            transition: all 0.2s ease !important;
        }

        .bg-blue-600:hover {
            background-color: #115e59 !important;
        }

        .bg-blue-50 {
            background-color: var(--primary-light) !important;
        }

        .bg-blue-100 {
            background-color: rgba(15, 118, 110, 0.2) !important;
        }

        .border-blue-600 {
            border-color: var(--primary) !important;
        }

        .border-blue-100 {
            border-color: rgba(15, 118, 110, 0.2) !important;
        }

        .border-blue-400 {
            border-color: var(--primary) !important;
        }

        .peer-checked\:bg-blue-600:checked~div {
            background-color: var(--primary) !important;
        }

        /* --- LOGO: LA CASA CON EL CORAZÓN --- */
        #auth-screen .text-blue-600 svg,
        #app-sidebar .text-blue-600 svg,
        #normal-mobile-topbar .text-blue-600 svg {
            color: var(--primary) !important;
            transform: scale(1.1);
            transition: all 0.3s ease;
        }

        #auth-screen .text-blue-600 svg:hover,
        #app-sidebar .text-blue-600 svg:hover {
            transform: scale(1.15);
            color: #115e59 !important;
        }

        #auth-screen h2.text-slate-800,
        #app-sidebar h2,
        #normal-mobile-topbar h1 {
            color: var(--primary);
        }

        /* --- ESTILIZACIÓN DE BOTONES VERDES --- */
        .bg-emerald-600 {
            background-color: #059669 !important;
            border: none !important;
        }

        .bg-emerald-600:hover {
            background-color: #047857 !important;
        }

        .screen {
            display: none;
            flex: 1;
            width: 100%;
            min-height: 0;
        }

        .screen.active {
            display: flex;
            flex-direction: column;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }



        .leaflet-container {
            z-index: 10;
            border-radius: 12px;
        }

        #map-wrapper {
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            box-shadow: var(--shadow-soft);
            transition: all 0.3s ease;
        }

        /* Modales */
        .custom-modal-bg {
            background: #ffffff;
            border-radius: 16px;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
    