﻿        /* ==========================================
           VARIABLES Y CONFIGURACIÓN PREMIUM (EJECUTIVA)
           ========================================== */
        :root {
            --primary: #6366f1;
            --primary-dark: #4f46e5;

            /* PALETA DE COLORES */
            --give-color: #3b82f6;
            --give-dark: #2563eb;
            --request-color: #eab308;
            --request-dark: #ca8a04;

            --text-main: #0f172a;
            --text-muted: #475569;
            --text-light: #f8fafc;
            --white: #ffffff;
            --radius-lg: 14px;
            --radius-md: 8px;
            --shadow-premium: 0 10px 30px -5px rgba(0, 0, 0, 0.15), 0 5px 15px -3px rgba(0, 0, 0, 0.05);
            --transition-smooth: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                                  opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                                  background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                                  border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                                  box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                                  color 0.25s cubic-bezier(0.4, 0, 0.2, 1);

            --base-font-size: 15px;

            /* ==========================================================
               👇 IMAGEN DE FONDO — CAMBIA SOLO ESTE ENLACE PARA PRUEBAS
               Pega aquí la URL de la imagen que quieras probar.
               ========================================================== */
            --bg-image-url: url('https://images.unsplash.com/photo-1593113598332-cd288d649433?auto=format&fit=crop&q=80&w=1920');

            /* Fondo sólido de respaldo si el enlace de arriba no carga (no tocar) */
            --bg-default-fallback: var(--bg-image-url),
                                   url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' fill='%230f172a'/></svg>");
            --bg-dynamic: var(--bg-default-fallback);

            --hero-title-size: 2.2rem;
            --hero-title-color: #ffffff;
            --hero-desc-size: 1.05rem;
            --hero-desc-color: #cbd5e1;

            --bars-bg-color: rgba(15, 23, 42, 0.7);
            --bg-overlay-opacity: 0.85;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        html { font-size: var(--base-font-size); background: transparent; }

        /* Fondo en una capa fija propia (div .bg-layer): evita el bug de
           background-attachment:fixed en Safari iOS y los saltos al hacer scroll. */
        .bg-layer {
            position: fixed;
            inset: 0;
            z-index: -1;
            background: linear-gradient(135deg, rgba(15, 23, 42, var(--bg-overlay-opacity)) 0%, rgba(30, 41, 59, var(--bg-overlay-opacity)) 100%),
                        var(--bg-dynamic) no-repeat center center;
            background-size: cover;
            transition: background 0.5s ease;
        }

        body {
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            color: var(--text-main);
            min-height: 100vh;
            min-height: 100dvh;
            line-height: 1.5;
            overflow-x: hidden;
            background: transparent;
            display: flex;
            flex-direction: column;
        }
        /* Que el contenido principal crezca para empujar el footer al fondo sin saltos */
        /* (gestionado más abajo junto al display de .app-window) */

        .container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }

        .sr-only {
            position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
            overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
        }

        /* Mejora de foco visible (accesibilidad) */
        :focus-visible {
            outline: 2px solid #a5b4fc;
            outline-offset: 2px;
            border-radius: 4px;
        }

        /* HEADER */
        .main-header {
            padding: 10px 0;
            background: var(--bars-bg-color);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            position: sticky; top: 0; z-index: 90;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            transition: var(--transition-smooth);
        }

        .header-flex { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; position: relative; }

        .logo {
            display: inline-flex; align-items: center;
            font-size: 1.6rem; font-weight: 900;
            color: var(--white); text-decoration: none; letter-spacing: -0.5px;
        }

        .logo-icon {
            display: inline-block; width: 1.3em; height: 1.3em;
            margin-right: 10px; background-repeat: no-repeat;
            background-position: center; background-size: contain;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='20' cy='20' r='12' fill='%23ef4444'/%3E%3Cpath d='M4,46 C4,36 12,32 20,32 C28,32 36,36 36,46 L4,46 L4,46 Z' fill='%23ef4444'/%3E%3Ccircle cx='80' cy='56' r='10' fill='%23ef4444'/%3E%3Cpath d='M66,78 C66,70 72,66 80,66 C88,66 94,70 94,78 L66,78 Z' fill='%23ef4444'/%3E%3Ccircle cx='50' cy='52' r='16' fill='%23475569'/%3E%3Cpath d='M44,52 L48,56 L58,46' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3Cpath d='M44,24 C54,16 68,18 78,28 L74,32 M78,28 L68,28 M78,28 L78,38' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3Cpath d='M56,80 C44,82 30,76 22,64 L26,60 M22,64 L32,64 M22,64 L22,54' stroke='%23ffffff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
        }

        .logo-text {
            background: linear-gradient(to right, var(--request-color), var(--give-color));
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            background-clip: text; display: inline-block;
        }

        /* Bloque Inicio / Pasarela: un solo botón segmentado, centrado en el header */
        .app-nav {
            display: flex; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08);
            padding: 3px; border-radius: 16px;
            width: auto; justify-content: center; gap: 2px;
            position: absolute; left: 50%; transform: translateX(-50%);
        }
        .nav-window-btn {
            background: none; border: none; padding: 5px 14px;
            color: #94a3b8; font-weight: 700; font-size: 0.76rem;
            cursor: pointer; border-radius: 13px;
            transition: var(--transition-smooth); flex: 0 0 auto; text-align: center;
            font-family: inherit; white-space: nowrap;
        }
        .nav-window-btn:hover { color: var(--white); }
        .nav-window-btn.active { background: var(--primary); color: var(--white); }
        .nav-controls { display: flex; align-items: center; width: auto; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
        /* ES / EN: un solo botón segmentado dividido entre las 2 opciones */
        .lang-selector { display: flex; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08); padding: 3px; border-radius: 16px; gap: 2px; }
        .lang-btn {
            background: none; border: none; padding: 5px 12px;
            font-size: 0.76rem; font-weight: 700; color: #94a3b8;
            cursor: pointer; border-radius: 13px; font-family: inherit; white-space: nowrap;
        }
        .lang-btn:hover { color: var(--white); }
        .lang-btn.active { background: var(--primary); color: var(--white); }

        /* SOLO ESCRITORIO: Inicio/Pasarela y ES/EN replican el deslizamiento y cambio
           de color del botón PEDIR/DAR, con el tamaño del botón "Iniciar sesión". */
        @media (min-width: 768px) {
            .app-nav, .lang-selector {
                background: rgba(15,23,42,0.8); border: 1px solid rgba(255,255,255,0.1);
                padding: 3px; border-radius: 16px; gap: 0; overflow: hidden;
            }
            /* Inicio/Pasarela centrado en el bloque; ES/EN como contenedor del slider */
            .app-nav { position: absolute; left: 50%; transform: translateX(-50%); }
            .lang-selector { position: relative; }
            /* píldora deslizante (opción 1 = ámbar, a la izquierda) */
            .app-nav::before, .lang-selector::before {
                content: ''; position: absolute; top: 3px; bottom: 3px; left: 3px;
                width: calc(50% - 3px); border-radius: 13px;
                background: var(--request-color); z-index: 0;
                transition: var(--transition-smooth);
            }
            /* opción 2 activa → desliza a la derecha y cambia a verde */
            .app-nav:has(.nav-window-btn:last-child.active)::before,
            .lang-selector:has(.lang-btn:last-child.active)::before {
                left: 50%; background: var(--give-color);
            }
            .nav-window-btn, .lang-btn {
                position: relative; z-index: 1; flex: 1 1 0; background: none;
                padding: 5px 12px; border-radius: 13px;
                font-size: 0.76rem; font-weight: 700; color: #94a3b8;
            }
            .nav-window-btn.active, .lang-btn.active { background: none; color: var(--white); }

            /* #1 + #6: menú de tamaño fijo (idéntico en español e inglés) y texto +15%.
               El min-width evita que el botón cambie de ancho al traducir. */
            .nav-window-btn { min-width: 104px; font-size: 0.874rem; }
            .lang-btn { min-width: 48px; font-size: 0.874rem; }
            /* "Salir" / "Log out" con ancho fijo para no cambiar de tamaño entre idiomas */
            .btn-logout { min-width: 76px; text-align: center; }
        }
        .admin-trigger { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); color: var(--white); padding: 6px 12px; border-radius: 20px; cursor: pointer; font-weight: 700; font-size: 0.8rem; font-family: inherit; }

        /* SPA */
        .app-window { display: none; }
        .app-window.active-window { display: block; }
        /* Altura mínima igualada para que el footer no salte al cambiar de ventana */
        main.app-window.active-window,
        section.app-window.active-window {
            flex: 1 0 auto;
            min-height: calc(100vh - 220px);
            min-height: calc(100dvh - 220px);
            display: flex;
            flex-direction: column;
        }
        main.app-window > section,
        section.app-window > .ledger-window-box { width: 100%; }

        /* HERO */
        .hero { text-align: center; padding: 32px 0 16px 0; }
        .hero h1 {
            font-size: var(--hero-title-size);
            color: var(--hero-title-color);
            font-weight: 900; letter-spacing: -0.5px;
            margin-bottom: 12px;
            text-shadow: 0 2px 8px rgba(0,0,0,0.3);
        }
        .hero p {
            font-size: var(--hero-desc-size);
            color: var(--hero-desc-color);
            max-width: 650px; margin: 0 auto 20px auto;
        }

        /* STATS (20% más pequeñas) */
        .stats-section { width: 100%; max-width: 880px; margin: 0 auto 40px auto; }
        .live-stats { display: flex; flex-direction: column; gap: 16px; }
        .stat-card {
            background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(30,41,59,0.7) 100%);
            padding: 19px 26px; border-radius: var(--radius-lg);
            border: 1px solid rgba(255,255,255,0.1);
            border-top: 3px solid; text-align: center;
            box-shadow: 0 8px 32px rgba(0,0,0,0.15);
            transform: translateY(0);
            transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
            opacity: 0;
            animation: slideUpFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }
        .stat-card.req-stat { border-top-color: var(--request-color); animation-delay: 0.1s; }
        .stat-card.give-stat { border-top-color: var(--give-color); animation-delay: 0.3s; }
        .stat-card.active-stat { border-top-color: var(--primary); animation-delay: 0.5s; }
        .stat-card:hover { transform: translateY(-5px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
        .stat-number {
            font-size: 2.6rem; font-weight: 900; color: var(--white);
            display: block; text-shadow: 0 2px 10px rgba(255,255,255,0.2);
            line-height: 1.1; margin-bottom: 5px;
        }
        .stat-label {
            font-size: 0.88rem; color: #cbd5e1;
            text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700;
        }

        @keyframes slideUpFade {
            0% { opacity: 0; transform: translateY(30px); }
            100% { opacity: 1; transform: translateY(0); }
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

        /* PASARELA */
        .interactive-box {
            max-width: 820px;
            margin: 20px auto 30px auto;
            text-align: center;
        }
        #panel-meta-outer h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.3px; color: var(--request-color); transition: var(--transition-smooth); }
        #panel-meta-outer p { color: #cbd5e1; font-size: 0.9rem; margin: 0; line-height: 1.5; }
        .toggle-container {
            display: inline-flex; background: rgba(15,23,42,0.8);
            padding: 6px; border-radius: 50px; margin-bottom: 24px;
            position: relative; border: 1px solid rgba(255,255,255,0.1);
            width: 100%; max-width: 340px;
        }
        .toggle-btn {
            background: none; border: none; padding: 10px 0;
            font-size: 0.95rem; font-weight: 700; cursor: pointer;
            border-radius: 40px; position: relative; z-index: 2;
            transition: var(--transition-smooth); color: #94a3b8; width: 50%;
            font-family: inherit;
        }
        .toggle-btn.active { color: var(--white); }
        .toggle-slider {
            position: absolute; top: 6px; left: 6px;
            height: calc(100% - 12px); width: calc(50% - 6px);
            border-radius: 40px; background: var(--request-color);
            z-index: 1; transition: var(--transition-smooth);
        }

        /* FORM */
        .window-viewport {
            position: relative; overflow: hidden;
            border-radius: var(--radius-lg);
            background: rgba(15,23,42,0.55);
            border: 1px solid rgba(255,255,255,0.08);
            box-shadow: 0 8px 32px rgba(0,0,0,0.2);
        }
        .window-wrapper { display: flex; width: 100%; transition: var(--transition-smooth); will-change: transform; }
        .window-wrapper.hidden-wrapper { visibility: hidden !important; transition: none !important; }

        .panel { width: 100%; padding: 24px; display: flex; flex-direction: column; gap: 14px; text-align: left; }

        .panel-form { display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0; }
        .form-restrict-msg {
            display: none; margin: 0; padding: 12px 14px; border-radius: var(--radius-md);
            background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.45);
            color: #fca5a5; font-size: 0.86rem; line-height: 1.45; font-weight: 600;
            text-align: left; align-items: flex-start; gap: 8px;
        }
        .form-restrict-msg.show { display: flex; }
        .form-restrict-msg .frm-icon { flex-shrink: 0; font-size: 1rem; }
        .form-restrict-msg .frm-link {
            background: none; border: none; padding: 0; margin: 0; cursor: pointer;
            color: #fff; font-weight: 800; font-family: inherit; font-size: inherit;
            text-decoration: underline; text-underline-offset: 2px;
        }
        .form-inputs-row { display: flex; flex-direction: column; gap: 12px; width: 100%; }
        .form-top-row { display: flex; gap: 12px; width: 100%; }
        .form-top-row .form-item { flex: 1 1 auto; min-width: 0; }
        .form-top-row .form-qty { flex: 0 0 90px; }
        .form-group { margin-bottom: 0; width: 100%; min-width: 0; }
        /* #3: etiquetas visibles en el formulario de publicar (mejor que solo placeholder) */
        .field-label { display: block; font-size: 0.82rem; font-weight: 700; color: #cbd5e1; margin-bottom: 6px; }
        .form-top-row { align-items: flex-end; }

        /* Subida de imagen del producto a donar (botón compacto en la fila superior) */
        .form-top-row .form-image-slot { flex: 0 0 auto; width: auto; min-width: 0; display: flex; flex-direction: column; }
        .give-image-btn {
            position: relative; display: flex; align-items: center; justify-content: center;
            width: 46px; height: 42px; box-sizing: border-box;
            border: 1px dashed rgba(255,255,255,0.28); border-radius: var(--radius-md);
            background: rgba(15,23,42,0.4); cursor: pointer; transition: var(--transition-smooth);
            color: #94a3b8;
        }
        .give-image-btn:hover { border-color: var(--give-color); background: rgba(15,23,42,0.6); color: #cbd5e1; }
        .give-image-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
        .give-image-btn .git-icon { font-size: 1.15rem; }
        .form-image-slot .give-image-preview {
            position: relative; width: 46px; height: 42px; box-sizing: border-box;
            border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-md);
            background: rgba(15,23,42,0.4);
        }
        .form-image-slot .give-image-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-md); display: block; }
        .form-image-slot .give-image-remove {
            position: absolute; top: -7px; right: -7px; z-index: 3;
            width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(15,23,42,0.6); cursor: pointer;
            background: #ef4444; color: #fff; font-size: 0.95rem; line-height: 1;
            display: flex; align-items: center; justify-content: center; padding: 0;
        }
        .form-image-slot .give-image-remove:hover { background: #dc2626; }

        /* Miniatura del producto en las tarjetas de la pasarela */
        .item-photo {
            display: block; width: 64px; max-width: 64px; height: 64px; object-fit: cover;
            border-radius: var(--radius-md); margin-top: 6px; border: 1px solid rgba(255,255,255,0.12);
        }

        .form-input {
            width: 100%; padding: 10px 14px;
            border: 1px solid rgba(255,255,255,0.15);
            border-radius: var(--radius-md);
            font-size: 0.95rem;
            background: rgba(15,23,42,0.4);
            color: var(--white); height: 42px;
            transition: var(--transition-smooth); box-sizing: border-box;
            font-family: inherit;
        }
        .form-input::placeholder { color: #94a3b8; }
        .form-input:focus { outline: none; border-color: var(--primary); background: rgba(15,23,42,0.7); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
        .form-input.input-light { color: var(--text-main); }
        .form-qty .form-input { text-align: center; }
        /* iOS hace zoom automático al enfocar inputs con fuente < 16px. En móvil
           forzamos 16px para que el formulario sea cómodo y no salte. */
        @media (max-width: 767px) {
            .form-input, .ls-input, select.form-input, input.tile-input, #chat-input { font-size: 16px; }
            .form-top-row { gap: 8px; }
            .form-top-row .form-qty { flex: 0 0 64px; }
        }

        .form-actions-area { width: 100%; display: flex; justify-content: center; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
        .btn-action { width: 100%; height: 42px; border: none; border-radius: var(--radius-md); font-size: 0.95rem; font-weight: 700; color: var(--white); cursor: pointer; transition: var(--transition-smooth); display: flex; justify-content: center; align-items: center; white-space: nowrap; padding: 0 24px; background: var(--request-color); box-sizing: border-box; font-family: inherit; }
        .btn-action.btn-give { background: var(--give-color); }
        .btn-action.btn-modal { width: 100%; margin-top: 24px; background: var(--give-color); }
        .spinner { display: none; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: var(--white); animation: spin 1s linear infinite; }

        .success-screen {
            display: none; position: absolute; inset: 0;
            flex-direction: column; align-items: center; justify-content: center;
            text-align: center; padding: 24px; gap: 6px; overflow: auto;
            border-radius: var(--radius-lg);
            animation: fadeIn 0.35s ease-out forwards;
        }
        .success-icon {
            width: 52px; height: 52px; background: #fef3c7; color: var(--request-color);
            border-radius: 50%; display: flex; align-items: center; justify-content: center;
            font-size: 1.6rem; margin: 0 auto 10px auto; box-shadow: 0 6px 20px rgba(0,0,0,0.25);
        }
        .success-screen h2 { color: var(--white); font-size: 1.4rem; margin-bottom: 16px; }
        .success-screen p { color: #cbd5e1; margin-bottom: 16px; max-width: 420px; line-height: 1.5; }
        .success-screen p:empty { display: none; margin: 0; }
        .btn-back {
            width: auto; padding: 12px 30px; height: auto; cursor: pointer;
            font-weight: 700; background: rgba(255,255,255,0.1);
            color: var(--white); border: 1px solid rgba(255,255,255,0.15);
            border-radius: var(--radius-md); font-family: inherit; font-size: 0.95rem;
        }

        /* LEDGER */
        .ledger-window-box { background: rgba(15,23,42,0.75); border-radius: var(--radius-lg); border: 1px solid rgba(255,255,255,0.08); padding: 30px; margin: 24px auto; max-width: 1000px; }
        .ledger-window-box h2 { color: var(--white); text-align: center; font-size: 1.75rem; margin-bottom: 20px; }
        .ledger-h2-mobile { display: none; }
        /* Buscador + filtro de la Pasarela */
        .ledger-search {
            background: rgba(15,23,42,0.5); border: 1px solid rgba(255,255,255,0.1);
            border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 22px;
            display: flex; flex-direction: column; gap: 12px;
        }
        .ls-row { display: flex; flex-direction: column; gap: 10px; }
        .ls-search-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
        .ls-cp-wrap { position: relative; flex: 0 0 auto; }
        .ls-search-wrap .ls-icon, .ls-cp-wrap .ls-icon {
            position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
            font-size: 1rem; opacity: 0.6; pointer-events: none;
        }
        .ls-input {
            width: 100%; min-height: 46px; box-sizing: border-box;
            background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
            border-radius: 24px; padding: 10px 40px 10px 40px; color: var(--white);
            font-size: 0.95rem; font-family: inherit; transition: var(--transition-smooth);
        }
        .ls-input::placeholder { color: #94a3b8; }
        .ls-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.25); }
        .ls-cp { width: 100%; box-sizing: border-box; padding-left: 18px; }
        @media (min-width: 768px) {
            .ls-cp-wrap { width: 160px; }
        }
        .ls-clear {
            position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
            background: rgba(255,255,255,0.12); border: none; color: #cbd5e1; cursor: pointer;
            width: 28px; height: 28px; border-radius: 50%; font-size: 1.1rem; line-height: 1;
            display: none; align-items: center; justify-content: center; font-family: inherit;
        }
        .ls-clear:hover { background: rgba(255,255,255,0.22); color: #fff; }
        .ls-clear.show { display: flex; }
        .ls-field-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .ls-field-label { color: #94a3b8; font-size: 0.82rem; font-weight: 700; flex-shrink: 0; }
        .ls-chips { display: flex; gap: 6px; flex-wrap: wrap; }
        .ls-chip {
            background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
            color: #cbd5e1; border-radius: 20px; padding: 8px 14px; min-height: 38px;
            font-size: 0.8rem; font-weight: 700; cursor: pointer; font-family: inherit;
            transition: var(--transition-smooth); display: inline-flex; align-items: center; gap: 6px;
        }
        .ls-chip:hover { background: rgba(255,255,255,0.12); color: var(--white); }
        .ls-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
        .ls-results {
            color: #cbd5e1; font-size: 0.85rem; font-weight: 600;
            display: none; align-items: center; gap: 8px; padding-top: 2px;
        }
        .ls-results.show { display: flex; }
        .ls-results strong { color: var(--white); }
        .ls-results .ls-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
        .ledger-empty-filter { color: #64748b; font-size: 0.88rem; font-style: italic; padding: 8px 4px; }
        @media (min-width: 768px) {
            .ls-row { flex-direction: row; align-items: center; }
            .ls-field-group { flex-shrink: 0; }
        }
        /* Historial de entregas (perfil) */
        .ledger-block.history { border-top-color: #22c55e; margin-top: 20px; }
        .ledger-block.history h3 { display: flex; align-items: center; gap: 8px; }
        .ledger-item.delivered-row { opacity: 0.92; }
        .delivered-chip {
            align-self: flex-start; margin-top: 6px; background: rgba(34,197,94,0.16);
            border: 1px solid rgba(34,197,94,0.45); color: #86efac; border-radius: 20px;
            padding: 4px 12px; font-size: 0.74rem; font-weight: 700;
        }
        .hist-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
        .hist-tags .delivered-chip { margin-top: 0; align-self: auto; }
        .hist-role {
            display: inline-block; border-radius: 20px; padding: 4px 12px;
            font-size: 0.72rem; font-weight: 700; border: 1px solid transparent;
        }
        .hist-role.owner { background: rgba(99,102,241,0.16); border-color: rgba(99,102,241,0.45); color: #c7d2fe; }
        .hist-role.guest { background: rgba(59,130,246,0.16); border-color: rgba(59,130,246,0.45); color: #bfdbfe; }
        .ledger-block { background: rgba(15,23,42,0.4); border-radius: var(--radius-md); padding: 20px; border-top: 3px solid var(--request-color); }
        .ledger-block.give { border-top-color: var(--give-color); }
        .ledger-block h3 { color: var(--white); font-size: 1.15rem; margin-bottom: 14px; }
        .ledger-list { display: flex; flex-direction: column; gap: 10px; }

        /* ===== FEED ÚNICO (solo móvil): tarjeta rica y tocable ===== */
        .feed-block { display: none; padding: 0; background: none; border-top: none; }
        .feed-block .ledger-list { gap: 10px; }
        .feed-card {
            display: flex; align-items: stretch; gap: 12px; position: relative;
            background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
            border-left: 4px solid var(--request-color); border-radius: 12px;
            padding: 10px 12px 10px 10px; cursor: pointer; min-height: 92px;
            transition: var(--transition-smooth); text-align: left;
        }
        .feed-card.give { border-left-color: var(--give-color); }
        .feed-card:active { background: rgba(255,255,255,0.08); }
        .fc-thumb {
            width: 58px; height: 58px; flex: 0 0 auto; border-radius: 10px;
            object-fit: cover; background: rgba(15,23,42,0.55);
            display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
            border: 1px solid rgba(255,255,255,0.06);
        }
        .fc-thumb-ph.request { background: rgba(234,179,8,0.14); }
        .fc-thumb-ph.give { background: rgba(59,130,246,0.14); }
        .fc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
        .fc-top { display: flex; align-items: center; gap: 8px; }
        .fc-badge {
            font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px;
            padding: 2px 8px; border-radius: 20px; flex-shrink: 0;
        }
        .fc-badge.request { background: var(--request-color); color: #3a2c00; }
        .fc-badge.give { background: var(--give-color); color: #fff; }
        .fc-time { font-size: 0.76rem; color: #94a3b8; margin-left: auto; flex-shrink: 0; }
        .fc-title { color: var(--white); font-weight: 700; font-size: 1rem; display: flex; align-items: baseline; gap: 6px; }
        .fc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
        .fc-title .qty-badge { flex: 0 0 auto; }
        .fc-meta { font-size: 0.82rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .feed-card .btn-coordinar { margin-top: 7px; align-self: flex-start; white-space: nowrap; }
        .feed-card .item-own-tag { margin-top: 7px; align-self: flex-start; }
        /* #4: chevron como pista de que la tarjeta es tocable (abre "Más detalles") */
        .fc-chev { align-self: center; flex: 0 0 auto; color: #64748b; font-size: 1.4rem; line-height: 1; padding-left: 2px; }
        .feed-empty-friendly { text-align: center; color: #94a3b8; padding: 30px 16px; font-size: 0.92rem; line-height: 1.6; }
        /* Al filtrar por un solo tipo, el bloque visible ocupa todo el ancho
           y los productos se reparten en varias columnas para aprovechar el espacio */
        #window-ledger .ledger-grid.single-type .ledger-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
            gap: 12px;
            align-items: start;
        }
        .ledger-item { background: rgba(255,255,255,0.04); padding: 10px 14px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 96px; }
        .item-product { color: var(--white); font-weight: 600; font-size: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
        .item-user-name { font-size: 0.8rem; color: #94a3b8; }
        .item-comment-text { font-size: 0.85rem; color: #cbd5e1; font-style: italic; margin-top: 2px; text-align: left; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .item-product-name { text-align: left; display: flex; flex-direction: column; }
        .item-date { font-size: 0.75rem; color: #94a3b8; background: rgba(0,0,0,0.2); padding: 3px 8px; border-radius: 6px; align-self: center; }

        .qty-badge {
            background: rgba(255,255,255,0.1); color: var(--white);
            padding: 2px 8px; border-radius: 12px; font-size: 0.75rem;
            font-weight: 800; border: 1px solid rgba(255,255,255,0.15);
            display: inline-flex; align-items: center; justify-content: center;
        }

        /* CMS (personalización, dentro del dashboard admin) */
        .cms-group { margin-bottom: 20px; }
        .cms-group label { display: block; font-size: 0.8rem; font-weight: 600; color: #94a3b8; margin-bottom: 6px; text-transform: uppercase; }
        .cms-input { width: 100%; background: #1e293b; border: 1px solid #334155; padding: 10px 14px; border-radius: 8px; color: var(--white); font-size: 0.9rem; font-family: inherit; }
        .cms-input.cms-mb { margin-bottom: 8px; }

        .cms-inline-controls { display: flex; gap: 10px; align-items: center; }
        .cms-inline-controls.boxed { background: #1e293b; padding: 8px; border-radius: 8px; border: 1px solid #334155; }
        .cms-inline-controls .label-hint { font-size: 0.8rem; color: #94a3b8; flex: 1; }
        .cms-color-picker { width: 44px; height: 44px; padding: 0; border: 1px solid #334155; border-radius: 8px; background: none; cursor: pointer; }

        .file-upload-wrapper { position: relative; width: 100%; height: 44px; background: #1e293b; border: 2px dashed #4f5569; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
        .file-upload-wrapper input[type="file"] { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
        .file-upload-text { font-size: 0.85rem; color: #cbd5e1; font-weight: 600; }
        .btn-cms-reset { width: 100%; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); color: #fca5a5; padding: 8px; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 0.8rem; font-family: inherit; }
        .range-container { display: flex; align-items: center; gap: 12px; flex: 1; }
        .range-container.boxed { background: #1e293b; padding: 10px; border-radius: 8px; border: 1px solid #334155; }
        .range-container input[type="range"] { flex: 1; }
        .range-value { font-weight: 700; background: var(--primary); padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; min-width: 48px; text-align: center; }

        /* AUTH / PERFIL DE USUARIO */
        .auth-area { display: flex; align-items: center; gap: 8px; }
        .btn-auth-open {
            background: rgba(255,255,255,0.16); border: none;
            color: var(--white); padding: 5px 12px; border-radius: 16px;
            min-width: 130px; box-sizing: border-box; justify-content: center;
            cursor: pointer; font-weight: 700; font-size: 0.76rem; font-family: inherit;
            display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
        }
        .btn-auth-open:hover { background: rgba(255,255,255,0.26); }
        .user-chip {
            display: none; align-items: center; gap: 8px;
            background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
            color: var(--white); padding: 4px 6px 4px 12px; border-radius: 30px;
            font-size: 0.82rem; font-weight: 700;
        }
        .user-chip .chip-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .btn-mi-perfil {
            background: rgba(255,255,255,0.16); border: none; color: var(--white);
            border-radius: 16px; padding: 5px 12px; font-size: 0.76rem; font-weight: 700;
            cursor: pointer; font-family: inherit; white-space: nowrap;
        }
        .btn-mi-perfil:hover { background: rgba(255,255,255,0.26); }
        /* Chip de sesión limpio (escritorio y móvil): solo el nombre + Salir.
           "Mi Perfil", el separador y el ícono 👤 se ocultan; el nombre es clicable. */
        .user-chip .btn-mi-perfil,
        .user-chip .chip-divider,
        .user-chip .chip-ico { display: none; }
        .user-chip .chip-name { font-weight: 700; }
        .chip-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.25); }
        .btn-logout {
            background: rgba(239,68,68,0.18); border: 1px solid rgba(239,68,68,0.3);
            color: #fecaca; border-radius: 18px; padding: 4px 10px;
            font-size: 0.74rem; font-weight: 700; cursor: pointer; font-family: inherit;
        }

        /* Bloqueo del formulario sin sesión */
        .login-gate {
            display: none; flex-direction: column; align-items: center;
            gap: 14px; text-align: center; padding: 38px 24px; color: #cbd5e1;
        }
        .login-gate.show { display: flex; }
        .login-gate p { color: #cbd5e1; font-size: 0.98rem; max-width: 380px; margin: 0; }
        .gate-icon {
            width: 48px; height: 48px; border-radius: 50%; display: flex;
            align-items: center; justify-content: center; font-size: 1.4rem;
            background: rgba(99,102,241,0.18); color: #a5b4fc;
        }

        /* Inputs legibles dentro de los modales (sobre fondo blanco) */
        .modal-body .form-input {
            background: #ffffff; border: 1px solid #cbd5e1; color: var(--text-main);
        }
        .modal-body .form-input::placeholder { color: #94a3b8; }
        .modal-body .form-input:focus { background: #ffffff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
        .modal-body .form-input[readonly] { background: #f1f5f9; color: #475569; cursor: not-allowed; }

        /* Form de registro */
        .reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
        .reg-grid .full { grid-column: 1 / -1; }
        .reg-section { margin-bottom: 18px; }
        .reg-section:last-of-type { margin-bottom: 8px; }
        .reg-section-title {
            display: flex; align-items: center; gap: 8px; margin: 0 0 12px 0;
            font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px;
            color: var(--primary); padding-bottom: 8px; border-bottom: 1px solid #e2e8f0;
        }
        .field-hint { font-size: 0.74rem; color: #94a3b8; margin: 5px 0 0 0; }
        .reg-actions { display: flex; gap: 10px; margin-top: 4px; }
        .btn-reg-cancel {
            flex: 0 0 auto; background: #f1f5f9; border: 1px solid #cbd5e1; color: var(--text-muted);
            border-radius: var(--radius-md); padding: 0 22px; height: 46px; font-weight: 700;
            font-size: 0.95rem; cursor: pointer; font-family: inherit;
        }
        .btn-reg-cancel:hover { background: #e2e8f0; }
        .btn-reg-submit { flex: 1 1 auto; margin-top: 0 !important; height: 46px; }
        select.form-input {
            appearance: none; -webkit-appearance: none; padding-right: 34px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
            background-repeat: no-repeat; background-position: right 10px center;
        }
        .cp-status { font-size: 0.78rem; font-weight: 600; margin: 6px 0 0 0; min-height: 16px; }
        .cp-status.loading { color: #b45309; }
        .cp-status.ok { color: #16a34a; }
        .cp-status.err { color: #ef4444; }
        .auth-switch { text-align: center; margin: 16px 0 0 0; font-size: 0.85rem; color: var(--text-muted); }
        .auth-switch-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; }
        .auth-switch-sep { color: #cbd5e1; }
        .auth-switch-acc { white-space: nowrap; }
        .auth-switch button {
            background: none; border: none; color: var(--primary);
            font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.85rem; padding: 0;
        }
        .item-location { font-size: 0.78rem; color: #94a3b8; margin-top: 3px; }

        /* DASHBOARD / MI PERFIL */
        .chip-name { cursor: pointer; }

        /* Hero del perfil */
        .profile-hero {
            display: flex; align-items: center; gap: 18px;
            padding: 4px 4px 22px 4px; margin-bottom: 4px;
        }
        .profile-avatar {
            width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.5rem; font-weight: 800; color: var(--white);
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            box-shadow: 0 6px 18px rgba(99,102,241,0.4);
        }
        .profile-info { min-width: 0; flex: 1; }
        .profile-eyebrow { font-size: 0.72rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #94a3b8; margin: 0 0 2px 0; }
        .profile-name { color: var(--white); font-size: 1.6rem; font-weight: 800; margin: 0; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .profile-sub { color: #94a3b8; font-size: 0.86rem; margin: 4px 0 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
        .role-badge {
            display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
            font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
            padding: 5px 11px; border-radius: 20px;
        }
        .role-badge.admin { background: rgba(99,102,241,0.2); color: #c7d2fe; border: 1px solid rgba(99,102,241,0.4); }
        .role-badge.user { background: rgba(59,130,246,0.16); color: #bfdbfe; border: 1px solid rgba(59,130,246,0.3); }

        .dash-card {
            background: rgba(15,23,42,0.4); border-radius: var(--radius-md);
            padding: 22px; border: 1px solid rgba(255,255,255,0.06);
        }
        .dash-card h3 { color: var(--white); font-size: 1.15rem; margin-bottom: 16px; }

        /* Tiles de datos */
        .data-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
        .data-tile {
            background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px; padding: 14px 16px; transition: var(--transition-smooth);
        }
        .data-tile:hover { background: rgba(255,255,255,0.07); transform: translateY(-2px); }
        .data-tile dt { color: #94a3b8; font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 5px 0; }
        .data-tile dd { color: var(--white); font-size: 0.98rem; font-weight: 600; margin: 0; word-break: break-word; }

        /* Stats del dashboard */
        .dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; }
        .dash-stat {
            background: rgba(15,23,42,0.4); border: 1px solid rgba(255,255,255,0.06);
            border-radius: 12px; padding: 18px; text-align: center; position: relative; overflow: hidden;
        }
        .dash-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
        .dash-stat.req::before { background: var(--request-color); }
        .dash-stat.give::before { background: var(--give-color); }
        .dash-stat .ds-num { display: block; color: var(--white); font-size: 2rem; font-weight: 900; line-height: 1; }
        .dash-stat .ds-label { display: block; color: #94a3b8; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 6px; }

        .dash-data-list { display: flex; flex-direction: column; gap: 0; margin: 0; }
        .dash-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 0.9rem; }
        .dash-row:last-child { border-bottom: none; }
        .dash-row dt { color: #94a3b8; font-weight: 600; margin: 0; }
        .dash-row dd { color: var(--white); text-align: right; word-break: break-word; margin: 0; }
        .dash-form { max-width: 460px; }
        .dash-form .form-group { margin-bottom: 12px; }
        .dash-form .auth-label { color: #cbd5e1; }
        .dash-msg { font-size: 0.85rem; font-weight: 600; margin: 10px 0 0 0; min-height: 16px; }
        .dash-msg.ok { color: #34d399; }
        .dash-msg.err { color: #fca5a5; }
        .dash-empty { color: #94a3b8; font-size: 0.9rem; font-style: italic; padding: 8px 0; }

        /* Controles de productos propios (Mi actividad) */
        .mi-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
        .mi-edit, .mi-del {
            background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
            border-radius: 7px; width: 40px; height: 40px; cursor: pointer;
            font-size: 0.85rem; line-height: 1; flex-shrink: 0; padding: 0;
        }
        .mi-edit:hover { background: rgba(255,255,255,0.16); }
        .mi-del:hover { background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.4); }
        .ledger-item.editing { display: block; }
        .myitem-edit { display: flex; flex-direction: column; gap: 8px; width: 100%; }
        .myitem-edit .mi-actions { display: flex; gap: 8px; justify-content: flex-end; }
        .myitem-edit .mi-cancel {
            background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
            color: var(--white); border-radius: 8px; padding: 0 16px; height: 38px;
            font-weight: 700; font-size: 0.85rem; cursor: pointer; font-family: inherit;
        }
        .myitem-edit .mi-save { width: auto !important; height: 38px; padding: 0 18px; }

        /* ===== RESUMEN (centro de acción del dashboard) ===== */
        .resumen-greet { margin-bottom: 18px; }
        .resumen-greet .rg-hi { color: var(--white); font-size: 1.4rem; font-weight: 800; margin: 0 0 4px; }
        .resumen-greet .rg-sub { color: #94a3b8; font-size: 0.95rem; margin: 0; line-height: 1.5; }
        .resumen-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
        .resumen-card {
            display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
            background: rgba(15,23,42,0.45); border: 1px solid rgba(255,255,255,0.08);
            border-left: 4px solid var(--primary); border-radius: 14px;
            padding: 16px 16px 15px; min-height: 104px; cursor: pointer; text-align: left;
            font-family: inherit; transition: var(--transition-smooth); position: relative;
        }
        .resumen-card:hover { background: rgba(255,255,255,0.06); transform: translateY(-2px); }
        .resumen-card:active { transform: translateY(0); }
        .resumen-card.req { border-left-color: var(--request-color); }
        .resumen-card.give { border-left-color: var(--give-color); }
        .resumen-card.alert { border-left-color: oklch(0.7 0.17 25); }
        .resumen-card .rc-ico { font-size: 1.5rem; line-height: 1; }
        .resumen-card .rc-num { font-size: 1.9rem; font-weight: 800; color: var(--white); line-height: 1; }
        .resumen-card .rc-label { font-size: 0.86rem; color: #cbd5e1; font-weight: 600; line-height: 1.3; }
        .resumen-card .rc-hint { font-size: 0.74rem; color: #94a3b8; }
        .resumen-card .rc-chev { position: absolute; top: 14px; right: 14px; color: #64748b; font-size: 0.9rem; }
        /* Tarjeta "publicar" rellena (acción principal del usuario) */
        .resumen-card.pub {
            border-left: none; background: var(--primary); border-color: transparent;
            justify-content: center;
        }
        .resumen-card.pub:hover { filter: brightness(1.06); background: var(--primary); transform: translateY(-2px); }
        .resumen-card.pub .rc-ico { font-size: 1.7rem; }
        .resumen-card.pub .rc-label { color: #fff; font-size: 1rem; font-weight: 800; }
        .resumen-card.pub .rc-hint { color: rgba(255,255,255,0.85); }
        .resumen-card.pub .rc-chev { color: rgba(255,255,255,0.9); }

        /* Pestañas del dashboard */
        .dash-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,0.12); }
        .dash-tab {
            background: none; border: none; color: #94a3b8; font-weight: 700;
            font-size: 0.9rem; font-family: inherit; cursor: pointer;
            padding: 11px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
            transition: color 0.2s ease;
        }
        .dash-tab:hover { color: #cbd5e1; }
        .dash-tab.active { color: var(--white); border-bottom-color: var(--primary); }
        .dash-tab { position: relative; }
        .tab-badge {
            display: none; align-items: center; justify-content: center;
            min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
            background: #ef4444; color: #fff; border-radius: 10px;
            font-size: 0.68rem; font-weight: 800; line-height: 1; vertical-align: middle;
            box-shadow: 0 0 0 2px rgba(239,68,68,0.25);
        }
        .tab-badge.show { display: inline-flex; animation: badgePop 0.3s ease-out; }
        .tab-badge.amber { background: var(--request-color); color: #3a2c00; box-shadow: 0 0 0 2px rgba(245,158,11,0.25); }
        @keyframes badgePop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
        /* Globito de aviso en el perfil */
        .profile-alert {
            display: none; align-items: center; gap: 8px; flex-shrink: 0;
            background: rgba(245,158,11,0.14); border: 1px solid rgba(245,158,11,0.4);
            color: #fcd34d; border-radius: 20px; padding: 7px 14px;
            font-size: 0.82rem; font-weight: 700; cursor: pointer;
            transition: var(--transition-smooth);
        }
        .profile-alert:hover { background: rgba(245,158,11,0.24); }
        .profile-alert.show { display: inline-flex; animation: badgePop 0.35s ease-out; }
        .profile-alert .pa-dot {
            display: inline-flex; align-items: center; justify-content: center;
            min-width: 20px; height: 20px; padding: 0 6px; background: #ef4444; color: #fff;
            border-radius: 10px; font-size: 0.72rem; font-weight: 800;
        }
        /* Etiqueta "Tu publicación" en la pasarela */
        .item-own-tag {
            align-self: flex-start; margin-top: 8px;
            background: rgba(148,163,184,0.14); border: 1px dashed rgba(148,163,184,0.4);
            color: #94a3b8; border-radius: 20px; padding: 5px 14px;
            font-size: 0.78rem; font-weight: 700;
        }
        .dash-panel { display: none; animation: fadeIn 0.3s ease-out; }
        .dash-panel.active { display: block; }
        .dash-panel .dash-card { margin-top: 0; }
        .dash-btn { width: 100%; margin-top: 4px; }

        /* Aviso "solo en computadora" para el panel de administración (visible solo en móvil) */
        .admin-desktop-note { display: none; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 34px 20px; background: rgba(15,23,42,0.4); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-md); }
        .admin-desktop-note .adn-icon { font-size: 2.4rem; }
        .admin-desktop-note h3 { color: var(--white); font-size: 1.1rem; margin: 0; }
        .admin-desktop-note p { color: #94a3b8; font-size: 0.92rem; margin: 0; max-width: 360px; line-height: 1.55; }
        @media (max-width: 767px) {
            /* En móvil solo "Personalización" (CMS) se queda en computadora;
               Moderación, Usuarios y Conversaciones SÍ funcionan en el teléfono. */
            .dash-panel[data-panel="cms"] > *:not(.admin-desktop-note) { display: none !important; }
            .dash-panel[data-panel="cms"].active .admin-desktop-note { display: flex; }
        }

        /* ---- Dashboard en móvil: fácil de usar ---- */
        @media (max-width: 767px) {
            /* Hero: permitir que envuelva para que nada se apriete o desborde */
            /* Hero compacto en móvil: identidad en una línea, sin correo/ubicación
               (esos datos están en la pestaña "Mis datos"). */
            .profile-hero { flex-wrap: wrap; align-items: center; gap: 10px 12px; padding-bottom: 14px; }
            .profile-avatar { width: 46px; height: 46px; font-size: 1.05rem; }
            .profile-info { flex: 1 1 0; min-width: 0; }
            .profile-eyebrow { display: none; }
            .profile-name { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
            .profile-sub { display: none; }
            .profile-alert { order: 4; width: 100%; justify-content: center; min-height: 44px; }
            /* Pestañas en una sola fila deslizable en lugar de amontonarse en varias líneas */
            .dash-tabs {
                flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
                gap: 2px; scrollbar-width: none; -ms-overflow-style: none;
            }
            .dash-tabs::-webkit-scrollbar { display: none; }
            .dash-tab { flex: 0 0 auto; padding: 13px 16px; min-height: 46px; }
            .dash-card { padding: 16px; }
        }

        /* ADMIN: moderación + personalización */
        .admin-card { margin-top: 24px; }
        .admin-card:first-child { margin-top: 0; }
        .admin-card h3 { display: flex; align-items: center; gap: 8px; }
        .mod-list { display: flex; flex-direction: column; gap: 10px; }
        .mod-item {
            display: flex; align-items: center; gap: 12px;
            background: rgba(255,255,255,0.04); padding: 10px 14px; border-radius: 8px;
            transition: var(--transition-smooth);
        }
        .mod-item:hover { background: rgba(255,255,255,0.07); }
        .mod-main { flex: 1; display: flex; flex-direction: column; min-width: 0; gap: 2px; }
        .mod-prod { color: var(--white); font-weight: 600; font-size: 0.95rem; }
        .mod-meta { font-size: 0.78rem; color: #94a3b8; }
        .mod-badge {
            font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
            padding: 4px 9px; border-radius: 20px; flex-shrink: 0;
        }
        .mod-badge.request { background: var(--request-color); color: #3a2c00; }
        .mod-badge.give { background: var(--give-color); color: #fff; }
        .mod-date { font-size: 0.74rem; color: #94a3b8; flex-shrink: 0; }
        .mod-del {
            background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3);
            color: #fca5a5; border-radius: 8px; width: 36px; height: 36px;
            cursor: pointer; font-size: 0.95rem; flex-shrink: 0; line-height: 1;
        }
        .mod-del:hover { background: rgba(239,68,68,0.3); }
        .admin-cms-grid { display: grid; grid-template-columns: 1fr; gap: 4px 22px; }
        .admin-cms-grid .cms-group { margin-bottom: 16px; }
        @media (min-width: 768px) {
            .admin-cms-grid { grid-template-columns: 1fr 1fr; }
        }

        /* Editar mis datos */
        .datos-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
        .datos-head h3 { margin: 0; }
        .datos-actions { display: flex; gap: 8px; align-items: center; }
        .btn-edit-datos, .btn-edit-cancel {
            background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
            color: var(--white); border-radius: 20px; padding: 8px 16px;
            font-weight: 700; font-size: 0.82rem; cursor: pointer; font-family: inherit; white-space: nowrap;
        }
        .btn-edit-datos:hover, .btn-edit-cancel:hover { background: rgba(255,255,255,0.14); }
        .btn-save-inline { width: auto !important; height: 38px; padding: 0 18px; }
        .data-tile.editing { background: rgba(255,255,255,0.06); }
        .data-tile.editing dt label { cursor: pointer; }
        .tile-input {
            width: 100%; box-sizing: border-box; margin-top: 2px;
            background: rgba(15,23,42,0.6); border: 1px solid rgba(255,255,255,0.18);
            border-radius: 7px; padding: 8px 10px; color: var(--white);
            font-size: 0.95rem; font-family: inherit; height: 38px;
        }
        .tile-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
        .tile-input[readonly] { background: rgba(15,23,42,0.85); color: #94a3b8; cursor: not-allowed; }
        .data-tile.editing .cp-status { margin-top: 6px; }

        /* ===== MÓVIL: en "Mis datos" sólo el botón Editar datos; al pulsarlo se abre
           una ventana con todos los datos editables ===== */
        @media (max-width: 767px) {
            .dash-panel[data-panel="datos"] .datos-head { margin-bottom: 0; }
            .dash-panel[data-panel="datos"] .datos-head h3 { display: none; }
            .dash-panel[data-panel="datos"] .btn-edit-datos { width: 100%; }
            .dash-panel[data-panel="datos"] #editForm { display: none; }

            /* La tarjeta de datos se convierte en una ventana a pantalla completa al editar */
            body.datos-editing .dash-panel[data-panel="datos"] .dash-card {
                position: fixed; inset: 0; z-index: 200; margin: 0;
                border-radius: 0; border: none; padding: 0;
                background: #0f172a; overflow-y: auto;
                display: flex; flex-direction: column;
            }
            body.datos-editing .dash-panel[data-panel="datos"] .datos-head {
                position: sticky; top: 0; z-index: 2; margin: 0;
                background: #0f172a; padding: 14px 16px;
                border-bottom: 1px solid rgba(255,255,255,0.1);
                align-items: center; justify-content: space-between;
            }
            body.datos-editing .dash-panel[data-panel="datos"] .datos-head h3 {
                display: block; flex: 1 1 auto; font-size: 1.1rem;
            }
            body.datos-editing .dash-panel[data-panel="datos"] #editForm {
                display: block; padding: 16px;
            }
            body.datos-editing .dash-panel[data-panel="datos"] .data-tiles {
                grid-template-columns: 1fr;
            }
        }

        /* Lista de usuarios (admin) */
        .users-list { display: flex; flex-direction: column; gap: 22px; }
        .users-group { display: flex; flex-direction: column; gap: 10px; }
        .users-group-title {
            display: flex; align-items: center; gap: 9px; margin: 0 0 2px;
            font-size: 0.78rem; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
            color: #94a3b8; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .users-group.active .users-group-title { color: #86efac; }
        .users-group.blocked .users-group-title { color: #fca5a5; }
        .users-group-title .ugt-count {
            display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px;
            padding: 0 7px; border-radius: 11px; background: rgba(255,255,255,0.1);
            color: #e2e8f0; font-size: 0.72rem; font-weight: 800;
        }
        .user-row {
            display: flex; align-items: center; gap: 14px;
            background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
            padding: 14px 16px; border-radius: 10px; transition: var(--transition-smooth);
        }
        .user-row:hover { background: rgba(255,255,255,0.07); }
        .user-row.is-blocked     { opacity: 0.6; }
        .user-row.is-deactivated { opacity: 0.55; border-left: 3px solid rgba(148,163,184,0.4); }
        .user-avatar {
            width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-weight: 800; font-size: 0.95rem; color: var(--white);
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        }
        .user-main { flex: 1; min-width: 0; }
        .user-name { color: var(--white); font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .user-detail { color: #94a3b8; font-size: 0.78rem; margin-top: 3px; line-height: 1.5; }
        .user-status {
            font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
            padding: 3px 9px; border-radius: 20px; flex-shrink: 0;
        }
        .user-status.active      { background: rgba(34,197,94,0.18);  color: #86efac;  border: 1px solid rgba(34,197,94,0.3);  }
        .user-status.blocked     { background: rgba(239,68,68,0.18);  color: #fca5a5;  border: 1px solid rgba(239,68,68,0.3);  }
        .user-status.deactivated { background: rgba(148,163,184,0.16); color: #94a3b8; border: 1px solid rgba(148,163,184,0.3); }
        .user-status.you { background: rgba(99,102,241,0.2); color: #c7d2fe; border: 1px solid rgba(99,102,241,0.35); }
        .btn-toggle-block {
            border: 1px solid; border-radius: 8px; padding: 8px 14px; font-weight: 700;
            font-size: 0.78rem; cursor: pointer; font-family: inherit; flex-shrink: 0; white-space: nowrap;
        }
        .btn-toggle-block.block { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.3); color: #fca5a5; }
        .btn-toggle-block.block:hover { background: rgba(239,68,68,0.26); }
        .btn-toggle-block.activate { background: rgba(34,197,94,0.14); border-color: rgba(34,197,94,0.3); color: #86efac; }
        .btn-toggle-block.activate:hover { background: rgba(34,197,94,0.26); }
        .btn-toggle-block:disabled { opacity: 0.35; cursor: not-allowed; }

        /* Personalización por bloques */
        .cms-section {
            background: rgba(15,23,42,0.4); border: 1px solid rgba(255,255,255,0.06);
            border-radius: 12px; padding: 20px; margin-bottom: 16px;
            transition: var(--transition-smooth);
        }
        .cms-section:hover { border-color: rgba(99,102,241,0.35); background: rgba(15,23,42,0.55); }
        .cms-section-title {
            display: flex; align-items: center; gap: 10px; margin: 0 0 16px 0;
            color: var(--white); font-size: 1.02rem; font-weight: 800;
            padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .cms-step {
            width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center;
            background: var(--primary); color: var(--white); font-size: 0.82rem; font-weight: 800;
        }
        .cms-section .cms-group:last-child { margin-bottom: 0; }
        @media (min-width: 700px) {
            /* Cada grupo aprovecha todo el ancho de su bloque (título, subtítulo, etc.) */
            .cms-section { display: block; }
            .cms-group { margin-bottom: 18px; }
            .cms-section .cms-group:last-child { margin-bottom: 0; }
            /* Fondo: intensidad + imagen lado a lado para aprovechar el espacio */
            .cms-section.cms-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
            .cms-section.cms-2col .cms-section-title { grid-column: 1 / -1; margin-bottom: 4px; }
            .cms-section.cms-2col .cms-group { margin-bottom: 0; }
        }

        .recover-help { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 18px 0; line-height: 1.5; }
        #recover-msg { color: #dc2626; }
        #recover-msg.ok { color: #16a34a; }

        /* FOOTER */
        .main-footer {
            background: var(--bars-bg-color);
            color: #cbd5e1; padding: 24px 0; font-size: 0.9rem;
            border-top: 1px solid rgba(255,255,255,0.05);
            transition: var(--transition-smooth);
        }
        .footer-minimal-flex { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; text-align: center; }
        .legal-links-minimal { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
        .footer-link-btn {
            background: none; border: none; color: #a5b4fc;
            font-weight: 600; text-decoration: none; font-size: 0.9rem;
            cursor: pointer; transition: color 0.2s;
            font-family: inherit; padding: 0;
        }
        .footer-link-btn:hover { color: #818cf8; }
        .copyright-minimal { color: #94a3b8; font-size: 0.85rem; text-align: center; margin: 0; }

        /* MODALES */
        .modal-overlay {
            position: fixed; inset: 0;
            background: rgba(15,23,42,0.7);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 9999;
            display: flex; justify-content: center; align-items: center;
            opacity: 0; pointer-events: none;
            transition: var(--transition-smooth);
        }
        .modal-overlay.active { opacity: 1; pointer-events: auto; }
        .modal-box {
            background: var(--white); width: 90%; max-width: 650px; max-height: 85vh; max-height: 85dvh;
            border-radius: var(--radius-lg); box-shadow: var(--shadow-premium);
            overflow: hidden; display: flex; flex-direction: column;
            transform: translateY(20px) scale(0.98);
            transition: var(--transition-smooth);
        }
        .modal-box.modal-narrow { max-width: 400px; }
        /* #2: bienvenida de primer uso */
        .welcome-intro { color: #475569; font-size: 0.95rem; margin: 0 0 18px; }
        .welcome-steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
        .welcome-steps li { display: flex; gap: 14px; align-items: flex-start; }
        .welcome-steps .ws-num {
            flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
            background: var(--primary); color: #fff; font-weight: 800;
            display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
        }
        .welcome-steps .ws-text { display: flex; flex-direction: column; gap: 3px; }
        .welcome-steps .ws-text strong { color: #1e293b; font-size: 1rem; }
        .welcome-steps .ws-text span { color: #475569; font-size: 0.88rem; line-height: 1.5; }
        .modal-overlay.active .modal-box { transform: translateY(0) scale(1); }

        .modal-header { padding: 20px 24px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
        .modal-header h3 { color: var(--text-main); font-size: 1.2rem; font-weight: 800; }
        .modal-close-btn { background: none; border: none; font-size: 1.6rem; color: #94a3b8; cursor: pointer; line-height: 1; transition: color 0.2s; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -8px -10px -8px 0; border-radius: 8px; }
        .modal-close-btn:hover { color: #ef4444; }
        .modal-body { padding: 24px; overflow-y: auto; color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }
        .modal-body h4 { color: var(--text-main); margin: 20px 0 8px 0; font-size: 1.05rem; }
        .modal-body ul { margin-left: 20px; margin-bottom: 16px; }

        .auth-label { color: var(--text-main); font-weight: 700; display: block; margin-bottom: 6px; font-size: 0.9rem; }
        .auth-error-msg { color: #ef4444; font-size: 0.85rem; font-weight: 600; margin-top: 10px; display: none; text-align: center; }
        .auth-demo-notice {
            margin-top: 14px; padding: 10px 12px;
            background: #fef3c7; color: #92400e;
            border-left: 3px solid #f59e0b;
            border-radius: 6px; font-size: 0.8rem; line-height: 1.4;
        }
        .form-group.mt-14 { margin-top: 14px; }

        /* MEDIA QUERIES */
        @media (min-width: 768px) {
            .live-stats { flex-direction: row; justify-content: center; gap: 26px; }
            .stat-card { min-width: 208px; flex: 1; max-width: 336px; }
            .admin-panel { width: 380px; right: -380px; border-left: 1px solid rgba(255,255,255,0.1); }

            .toggle-container { width: auto; max-width: none; }
            .toggle-btn { width: 140px; }

            .interactive-box { max-width: 880px; }

            .panel {
                display: grid;
                grid-template-columns: 220px 1fr;
                align-items: start;
                gap: 24px;
                padding: 20px 24px;
            }
            #panel-meta-outer { padding-top: 4px; text-align: left; }
            #panel-meta-outer h2 { font-size: 1.5rem; line-height: 1.2; }

            .panel-form { gap: 10px; }
            .form-inputs-row {
                display: flex;
                flex-direction: column;
                gap: 10px;
                min-width: 0;
            }
            .form-top-row { display: flex; gap: 10px; }
            .form-top-row .form-item { flex: 1 1 auto; min-width: 0; }
            .form-top-row .form-qty { flex: 0 0 100px; }
            .form-actions-area { padding-top: 12px; }
        }

        @media (min-width: 1024px) {
            .container { padding: 0 24px; }
            .hero p { margin-bottom: 24px; }

            .panel { grid-template-columns: 260px 1fr; gap: 28px; padding: 22px 28px; }

            .ledger-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
            #window-ledger .ledger-grid.single-type { grid-template-columns: 1fr; }
            .ledger-block { min-height: 360px; }
        }

        /* Accesibilidad: respetar preferencia de movimiento reducido */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
                scroll-behavior: auto !important;
            }
            .stat-card { opacity: 1; }
        }

        /* ---------- CHAT INTERNO / COORDINACIÓN ---------- */
        .btn-coordinar {
            align-self: flex-start; margin-top: 8px;
            background: rgba(99,102,241,0.16); border: 1px solid rgba(99,102,241,0.45);
            color: #c7d2fe; border-radius: 20px; padding: 5px 14px;
            font-size: 0.78rem; font-weight: 700; cursor: pointer; font-family: inherit;
            transition: var(--transition-smooth);
        }
        .btn-coordinar:hover { background: rgba(99,102,241,0.3); color: #fff; }
        .btn-coordinar.done { background: rgba(34,197,94,0.16); border-color: rgba(34,197,94,0.5); color: #86efac; cursor: default; }
        .item-product-name { display: flex; flex-direction: column; }

        /* Acciones de cada item de la pasarela. En escritorio el contenedor no
           genera caja (display:contents) → el layout web queda exactamente igual. */
        .item-actions { display: contents; }
        .btn-detalles {
            display: none; align-items: center; justify-content: center; gap: 5px;
            background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18);
            color: #cbd5e1; border-radius: 20px; padding: 5px 14px;
            font-size: 0.78rem; font-weight: 700; cursor: pointer; font-family: inherit;
            transition: var(--transition-smooth);
        }
        .btn-detalles:hover { background: rgba(255,255,255,0.12); color: #fff; }

        /* Contenido del modal "Más detalles" */
        .detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
        .detail-date { color: #94a3b8; font-size: 0.8rem; flex-shrink: 0; }
        .detail-product { color: var(--text-main); font-size: 1.2rem; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.3; }
        .detail-product .detail-qty { background: rgba(15,23,42,0.08); color: var(--text-main); border-color: rgba(15,23,42,0.15); }
        .detail-user { color: var(--text-muted); font-weight: 600; margin: 0 0 14px; font-size: 0.95rem; }
        .detail-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius-md); margin: 0 0 14px; display: block; }
        .detail-comment { color: var(--text-main); margin: 0 0 14px; line-height: 1.55; }
        .detail-loc { color: var(--text-muted); margin: 0 0 18px; font-size: 0.92rem; }
        .detail-action .btn-action { width: 100%; }
        .detail-status { text-align: center; font-weight: 700; padding: 12px; border-radius: var(--radius-md); }
        .detail-status.done { background: rgba(34,197,94,0.12); color: #16a34a; }
        .detail-status.own { background: rgba(148,163,184,0.14); color: #64748b; }

        /* ===== AJUSTES MÓVIL: encabezado + pasarela compacta ===== */
        @media (max-width: 767px) {
            /* En móvil se quita la imagen/gradiente de fondo (fondo plano) */
            .bg-layer { display: none; }
            body { background: #0f172a; }
            /* Header móvil limpio: logo + (ES/EN · sesión). Inicio/Pasarela pasan a la barra inferior */
            .app-nav { display: none; }
            /* Chip de sesión compacto: "Mi Perfil" ya vive en la barra inferior, así
               que en el header solo dejamos identidad + Salir para no desbordar. */
            .user-chip .btn-mi-perfil,
            .user-chip .chip-divider { display: none; }
            .user-chip { padding: 4px 6px 4px 11px; gap: 6px; max-width: 100%; min-width: 0; }
            .user-chip .chip-name { max-width: 92px; }
            .header-flex { flex-wrap: nowrap; gap: 8px; }
            .logo { flex: 0 1 auto; min-width: 0; order: 0; font-size: 1.3rem; }
            .logo-text { overflow: hidden; text-overflow: ellipsis; }
            .nav-controls { display: flex; order: 1; flex: 0 0 auto; gap: 8px; flex-wrap: nowrap; }
            .lang-selector, .auth-area { flex: 0 0 auto; }
            /* El botón de iniciar sesión se adapta al tamaño de su texto.
               #3: en móvil lo hacemos llamativo (color primario) para que no se pierda. */
            .btn-auth-open { min-width: 0; background: var(--primary); color: #fff; font-weight: 800; }
            /* En móvil la Pasarela usa un FEED ÚNICO (una sola columna, cronológico).
               Las dos columnas de escritorio se ocultan; el feed toma su lugar. */
            #window-ledger .ledger-grid .ledger-block:not(.feed-block) { display: none !important; }
            #window-ledger .ledger-grid .feed-block { display: block !important; }
            /* Pasarela compacta: producto+cantidad en una línea y 2 botones debajo */
            #window-ledger .ledger-item { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 14px; }
            #window-ledger .ledger-item .item-user-name,
            #window-ledger .ledger-item .item-comment-text,
            #window-ledger .ledger-item .item-photo,
            #window-ledger .ledger-item .item-location,
            #window-ledger .ledger-item .item-date { display: none; }
            #window-ledger .ledger-item .item-product { flex-wrap: nowrap; gap: 8px; font-size: 0.98rem; }
            #window-ledger .ledger-item .ip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
            #window-ledger .ledger-item .item-product .qty-badge { flex: 0 0 auto; }
            #window-ledger .ledger-item .item-actions { display: flex; gap: 8px; margin-top: 2px; }
            #window-ledger .ledger-item .item-actions > * {
                flex: 1 1 0; min-width: 0; margin: 0; align-self: stretch;
                min-height: 44px; display: flex; align-items: center; justify-content: center;
                text-align: center; white-space: nowrap; border-radius: 8px;
            }
            #window-ledger .ledger-item .btn-detalles { display: flex; }
        }

        /* Modal de chat */
        .modal-chat { max-width: 540px; width: 100%; }
        .chat-body { display: flex; flex-direction: column; gap: 0; }
        .chat-meta {
            background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2);
            border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 12px;
        }
        .chat-meta .cm-item { color: #1e293b; font-weight: 700; font-size: 0.98rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .chat-meta .cm-parties { color: #64748b; font-size: 0.8rem; margin-top: 5px; }
        .chat-type-badge { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 9px; border-radius: 20px; }
        .chat-type-badge.give { background: var(--give-color); color: #fff; }
        .chat-type-badge.request { background: var(--request-color); color: #3a2c00; }
        .chat-status { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
        .chat-pill {
            display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 700;
            padding: 5px 11px; border-radius: 20px; background: rgba(148,163,184,0.18); color: #475569;
            border: 1px solid rgba(148,163,184,0.25);
        }
        .chat-pill.on.deliver { background: rgba(59,130,246,0.16); color: #1d4ed8; border-color: rgba(59,130,246,0.45); }
        .chat-pill.on.receive { background: rgba(34,197,94,0.16); color: #15803d; border-color: rgba(34,197,94,0.45); }
        .chat-pill.flag { background: rgba(239,68,68,0.14); color: #b91c1c; border-color: rgba(239,68,68,0.4); }
        .chat-messages {
            background: #ffffff; border: 1px solid #e2e8f0;
            border-radius: var(--radius-md); padding: 14px; height: 280px; overflow-y: auto;
            display: flex; flex-direction: column; gap: 10px;
        }
        .chat-empty-msg { color: #64748b; font-size: 0.85rem; text-align: center; margin: auto 0; }
        .chat-msg { max-width: 78%; display: flex; flex-direction: column; gap: 2px; }
        .chat-msg .cm-author { font-size: 0.68rem; font-weight: 700; color: #64748b; padding: 0 4px; }
        .chat-msg .cm-bubble {
            background: #f1f5f9; color: #1e293b; padding: 8px 12px;
            border-radius: 12px; font-size: 0.88rem; line-height: 1.4; word-break: break-word;
        }
        .chat-msg .cm-time { font-size: 0.64rem; color: #64748b; padding: 0 4px; }
        .chat-msg.mine { align-self: flex-end; align-items: flex-end; }
        .chat-msg.mine .cm-bubble { background: var(--primary); color: #fff; }
        .chat-msg.system { align-self: center; max-width: 92%; align-items: center; }
        .chat-msg.system .cm-bubble {
            background: #fef3c7; color: #92400e; font-size: 0.76rem;
            font-style: italic; text-align: center; border-radius: 20px;
        }
        .chat-readonly-note { color: #b91c1c; font-size: 0.8rem; text-align: center; margin: 10px 0 0 0; }
        .chat-form { display: flex; gap: 8px; margin-top: 12px; }
        .chat-form .form-input { flex: 1; }
        .btn-chat-send { width: auto !important; flex: 0 0 auto; padding: 0 20px; height: 44px; margin: 0 !important; background: var(--primary); }
        .btn-chat-send:hover { background: var(--primary-dark); }
        .chat-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
        .chat-act-btn {
            flex: 1 1 auto; min-width: 120px; min-height: 44px; border: 1px solid; border-radius: var(--radius-md);
            padding: 11px 12px; font-size: 0.82rem; font-weight: 700; cursor: pointer; font-family: inherit;
            background: transparent; transition: var(--transition-smooth);
        }
        .chat-act-btn.deliver { border-color: rgba(59,130,246,0.5); color: #93c5fd; }
        .chat-act-btn.deliver:hover:not(:disabled) { background: rgba(59,130,246,0.18); }
        .chat-act-btn.receive { border-color: rgba(34,197,94,0.5); color: #86efac; }
        .chat-act-btn.receive:hover:not(:disabled) { background: rgba(34,197,94,0.18); }
        .chat-act-btn.report { border-color: rgba(239,68,68,0.5); color: #fca5a5; }
        .chat-act-btn.report:hover:not(:disabled) { background: rgba(239,68,68,0.16); }
        .chat-act-btn.close { border-color: rgba(148,163,184,0.5); color: #cbd5e1; }
        .chat-act-btn.close:hover:not(:disabled) { background: rgba(148,163,184,0.16); }
        .chat-act-btn:disabled { opacity: 0.45; cursor: default; }

        /* Listas de conversaciones (perfil / admin) */
        .chats-list { display: flex; flex-direction: column; gap: 10px; }
        .chat-row {
            display: flex; align-items: center; gap: 12px; cursor: pointer;
            background: rgba(255,255,255,0.04); padding: 11px 14px; border-radius: 8px;
            transition: var(--transition-smooth); border: 1px solid transparent;
        }
        .chat-row:hover { background: rgba(255,255,255,0.07); border-color: rgba(99,102,241,0.4); }
        .chat-row.flagged { border-color: rgba(239,68,68,0.5); }
        .chat-row .cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
        .chat-row .cr-top { color: var(--white); font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .chat-row .cr-sub { color: #94a3b8; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .chat-row .cr-tags { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
        .cr-tag { font-size: 0.64rem; font-weight: 700; padding: 3px 8px; border-radius: 12px; background: rgba(148,163,184,0.16); color: #cbd5e1; }
        .cr-tag.deliver { background: rgba(59,130,246,0.18); color: #93c5fd; }
        .cr-tag.receive { background: rgba(34,197,94,0.18); color: #86efac; }
        .cr-tag.flag { background: rgba(239,68,68,0.18); color: #fca5a5; }
        .cr-actions { display: flex; gap: 6px; flex-shrink: 0; }
        .cr-btn {
            background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: #e2e8f0;
            border-radius: 6px; padding: 6px 11px; font-size: 0.76rem; font-weight: 700; cursor: pointer; font-family: inherit;
        }
        .cr-btn:hover { background: rgba(255,255,255,0.16); }
        .cr-btn.dl { color: #93c5fd; border-color: rgba(59,130,246,0.4); }

        /* ============================================================
           MEJORAS DE EXPERIENCIA MÓVIL (solo ≤767px)
           ============================================================ */
        .mobile-bottom-nav, .mobile-fab { display: none; }

        @media (max-width: 767px) {
            /* Menos blur (rinde mejor en gamas medias) */
            /* === ANDROID · ANTI-PARPADEO ===
               En móvil el backdrop-filter sobre el fondo fijo hace que Chrome de
               Android repinte en cada cuadro al hacer scroll o al cambiar de pantalla.
               Lo quitamos y usamos fondos sólidos casi idénticos. */
            .main-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(15,23,42,0.98); }
            .ledger-window-box { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(17,25,44,0.95); }
            .mobile-bottom-nav { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(15,23,42,0.99) !important; }
            .modal-overlay { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(15,23,42,0.88) !important; }
            .stat-card, .window-viewport { backdrop-filter: none; -webkit-backdrop-filter: none; }
            /* Capa de fondo en su propia capa de composición → deja de repintarse bajo el header */
            .bg-layer { transform: translateZ(0); will-change: transform; }
            /* Sin destello al entrar a los paneles del dashboard */
            .dash-panel { animation: none; }
            .app-window, .ledger-window-box { -webkit-backface-visibility: hidden; backface-visibility: hidden; }

            /* Hero un poco más compacto para evitar saltos de línea raros */
            .hero { padding: 22px 0 10px; }
            .hero h1 { font-size: clamp(1.6rem, 7.5vw, 2.1rem); }

            /* --- BARRA DE NAVEGACIÓN INFERIOR --- */
            body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
            .mobile-bottom-nav {
                display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
                background: rgba(15,23,42,0.97);
                backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
                border-top: 1px solid rgba(255,255,255,0.1);
                padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
                justify-content: space-around; align-items: stretch;
            }
            .mbn-btn {
                flex: 1 1 0; background: none; border: none; color: #94a3b8; position: relative;
                display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                font-family: inherit; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.2px;
                padding: 6px 4px; min-height: 52px; cursor: pointer; border-radius: 12px;
                transition: color 0.18s ease, background 0.18s ease;
            }
            .mbn-btn .mbn-ico { font-size: 1.35rem; line-height: 1; }
            /* #1: badge de avisos sobre "Mi Perfil" */
            .mbn-badge {
                position: absolute; top: 2px; left: 50%; margin-left: 4px;
                min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
                background: var(--request-color); color: #3a2c00;
                font-size: 0.62rem; font-weight: 800; line-height: 1;
                display: flex; align-items: center; justify-content: center;
                box-shadow: 0 0 0 2px rgba(15,23,42,0.97);
            }
            .mbn-btn.active { color: var(--white); background: rgba(255,255,255,0.06); }
            .mbn-btn:active { background: rgba(255,255,255,0.1); }

            /* --- BOTÓN FLOTANTE (crear publicación), solo en la Pasarela --- */
            .mobile-fab {
                display: flex; position: fixed; right: 16px;
                bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 151;
                width: 56px; height: 56px; border-radius: 50%; border: none;
                background: var(--primary); color: #fff; font-size: 2rem; font-weight: 300; line-height: 1;
                align-items: center; justify-content: center; cursor: pointer;
                box-shadow: 0 8px 22px rgba(0,0,0,0.4);
            }
            .mobile-fab:active { transform: scale(0.93); }
            body:not(.on-ledger) .mobile-fab { display: none; }

            /* --- PASARELA: buscador/filtro fijo al hacer scroll --- */
            #window-ledger .ledger-search {
                position: sticky;
                top: 52px;           /* altura real del header en móvil */
                z-index: 80;         /* por encima de tarjetas y feeds */
                margin-left: -2px; margin-right: -2px;
                background: rgba(15,23,42,0.98) !important;   /* fondo opaco — nada se cuela por debajo */
                -webkit-backdrop-filter: none !important;
                backdrop-filter: none !important;
                box-shadow: 0 4px 20px rgba(0,0,0,0.6);
            }
            /* Evitar que las tarjetas del feed creen contextos de apilamiento
               que compitan con el filtro sticky */
            #window-ledger .feed-card,
            #window-ledger .ledger-item {
                position: relative;
                z-index: 1;
            }
            #window-ledger .ledger-window-box { padding-top: 16px; }
            /* En móvil el encabezado dice "Pasarela" en vez del título largo */
            #window-ledger .ledger-h2-desktop { display: none; }
            #window-ledger .ledger-h2-mobile { display: block; }

            /* Botones de acción de cada item con buen target táctil */
            #window-ledger .ledger-item .item-actions > * { min-height: 46px; font-size: 0.9rem; }

            /* --- FORMULARIO Pedir/Dar: inputs y botón más cómodos --- */
            .panel-form .form-input { min-height: 48px; }
            .btn-action { height: 50px; font-size: 1rem; }

            /* --- PESTAÑAS DEL PERFIL: pista visual de scroll horizontal --- */
            .dash-tabs { position: relative; -webkit-overflow-scrolling: touch; }
            .dash-tabs-wrap { position: relative; }
            .dash-tabs-wrap::after {
                content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 34px;
                pointer-events: none; border-radius: 0 8px 8px 0;
                background: linear-gradient(to right, rgba(15,23,42,0), rgba(15,23,42,0.9));
            }

            /* --- MODALES como hoja a pantalla completa --- */
            .modal-overlay { align-items: stretch; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
            .modal-box, .modal-box.modal-narrow {
                width: 100%; max-width: none; height: 100%;
                max-height: 100dvh; border-radius: 0;
                transform: translateY(28px); margin: 0;
            }
            .modal-overlay.active .modal-box { transform: translateY(0) scale(1); }
            .modal-header {
                padding-top: calc(16px + env(safe-area-inset-top));
                position: sticky; top: 0; z-index: 2;
            }
            .modal-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); flex: 1 1 auto; }
            .reg-actions {
                position: sticky; bottom: 0; background: var(--white);
                padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
                margin-top: 8px; z-index: 2;
            }

            /* --- CHAT a pantalla completa con campo anclado abajo --- */
            .modal-box.modal-chat { height: 100%; max-height: 100dvh; }
            .modal-chat .chat-body { flex: 1 1 auto; min-height: 0; }
            .modal-chat .chat-messages { flex: 1 1 auto; height: auto; min-height: 0; }
            .modal-chat .chat-form {
                position: sticky; bottom: 0; background: var(--white);
                padding: 10px 0 calc(8px + env(safe-area-inset-bottom)); margin-top: 8px;
            }
        }

        /* ══════════════════════════════════════════════════════
           PESTAÑA BD — Base de datos
           ══════════════════════════════════════════════════════ */
        .bd-section {
            background: rgba(15,23,42,0.4); border: 1px solid rgba(255,255,255,0.07);
            border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px;
        }
        .bd-section:last-child { margin-bottom: 0; }
        .bd-section-title {
            color: var(--white); font-size: 1.05rem; font-weight: 800;
            margin: 0 0 16px; display: flex; align-items: center; gap: 8px;
        }

        /* Estado del servidor */
        .bd-status-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
            gap: 12px; margin-bottom: 14px;
        }
        .bd-status-card {
            background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
            border-radius: 10px; padding: 14px 16px;
            display: flex; align-items: center; gap: 12px;
        }
        .bd-dot {
            width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
            box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
        }
        .bd-dot-on  { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.5); }
        .bd-dot-off { background: #ef4444; }
        .bd-ico  { font-size: 1.3rem; flex-shrink: 0; }
        .bd-lbl  { color: #94a3b8; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
        .bd-val  { color: var(--white); font-size: 0.9rem; font-weight: 700; }
        .bd-refresh-btn {
            background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
            color: #cbd5e1; border-radius: 8px; padding: 8px 16px;
            font-size: 0.82rem; font-weight: 700; cursor: pointer; font-family: inherit;
            transition: background-color 0.2s ease;
        }
        .bd-refresh-btn:hover { background: rgba(255,255,255,0.13); color: #fff; }

        /* Registros en BD */
        .bd-records-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
            gap: 12px; margin-bottom: 12px;
        }
        .bd-record-card {
            background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px; padding: 18px 14px; text-align: center;
            display: flex; flex-direction: column; align-items: center; gap: 6px;
        }
        .bd-record-ico  { font-size: 1.6rem; }
        .bd-record-num  { color: var(--white); font-size: 1.8rem; font-weight: 900; line-height: 1; }
        .bd-record-lbl  { color: #94a3b8; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
        .bd-note {
            color: #64748b; font-size: 0.82rem; margin: 0;
            padding: 10px 12px; background: rgba(255,255,255,0.03);
            border-radius: 8px; border: 1px solid rgba(255,255,255,0.06);
        }
        .bd-note strong { color: #94a3b8; }

        /* Barra de almacenamiento */
        .bd-storage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
        .bd-storage-used { color: var(--white); font-size: 1.4rem; font-weight: 800; }
        .bd-storage-total { color: #94a3b8; font-size: 0.9rem; }
        .bd-bar {
            width: 100%; height: 16px; border-radius: 10px;
            background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 8px;
        }
        .bd-bar-fill {
            height: 100%; border-radius: 10px;
            transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
        }
        .bd-storage-foot { display: flex; justify-content: space-between; color: #94a3b8; font-size: 0.82rem; font-weight: 600; margin-bottom: 12px; }

        /* Exportar / Importar */
        .bd-backup-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
        }
        @media (max-width: 767px) { .bd-backup-grid { grid-template-columns: 1fr; } }
        .bd-backup-block {
            background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px; padding: 16px;
        }
        .bd-backup-h    { color: var(--white); font-size: 0.95rem; font-weight: 800; margin: 0 0 8px; }
        .bd-backup-desc { color: #94a3b8; font-size: 0.82rem; margin: 0 0 14px; line-height: 1.55; }
        .bd-backup-desc code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px; font-size: 0.82rem; color: #c7d2fe; }
        .bd-action-btn  { width: 100% !important; height: 42px; }
        .bd-import-label {
            display: flex; align-items: center; justify-content: center;
            width: 100%; height: 42px; border-radius: var(--radius-md);
            background: rgba(255,255,255,0.08); border: 1px dashed rgba(255,255,255,0.25);
            color: #cbd5e1; font-size: 0.9rem; font-weight: 700; cursor: pointer;
            font-family: inherit; transition: background-color 0.2s ease;
        }
        .bd-import-label:hover { background: rgba(255,255,255,0.14); color: #fff; }
        .bd-import-filename {
            color: #94a3b8; font-size: 0.8rem; margin: 8px 0 0; min-height: 16px;
        }

        /* Registro de auditoría */
        .bd-audit-list {
            display: flex; flex-direction: column; gap: 2px;
            max-height: 360px; overflow-y: auto;
            border: 1px solid rgba(255,255,255,0.06); border-radius: 8px;
        }
        .bd-audit-row {
            display: flex; align-items: center; gap: 12px;
            padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .bd-audit-row:last-child { border-bottom: none; }
        .bd-audit-ico  { font-size: 1.05rem; flex-shrink: 0; }
        .bd-audit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .bd-audit-action {
            color: var(--white); font-size: 0.86rem; font-weight: 700;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .bd-audit-meta {
            color: #94a3b8; font-size: 0.76rem;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .bd-audit-time { color: #64748b; font-size: 0.72rem; flex-shrink: 0; white-space: nowrap; }

        /* ── BAJA DE CUENTA ─────────────────────────────────────── */

        /* Zona de peligro en "Mis datos" */
        /* Admin no ve la zona de peligro — es solo para usuarios regulares */
        body.is-admin .danger-zone { display: none !important; }
        /* En edición de datos (móvil full-screen), ocultar para no confundir */
        body.datos-editing .danger-zone { display: none !important; }

        .danger-zone {
            margin-top: 28px;
            padding: 18px 20px;
            border: 1px solid rgba(239,68,68,0.25);
            border-radius: var(--radius-md);
            background: rgba(239,68,68,0.05);
        }
        .danger-zone-title {
            color: #fca5a5; font-weight: 800; font-size: 0.88rem;
            text-transform: uppercase; letter-spacing: 0.5px;
            margin: 0 0 6px;
        }
        .danger-zone-desc {
            color: #94a3b8; font-size: 0.85rem; margin: 0 0 14px; line-height: 1.5;
        }
        .btn-deactivate-open {
            background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35);
            color: #fca5a5; border-radius: var(--radius-md); padding: 10px 18px;
            font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: inherit;
            transition: background-color 0.25s cubic-bezier(0.4,0,0.2,1);
        }
        .btn-deactivate-open:hover { background: rgba(239,68,68,0.22); color: #fff; }

        /* Botón principal del modal de baja */
        .btn-deactivate {
            width: 100%; margin-top: 20px; height: 46px; border: none;
            border-radius: var(--radius-md); background: #ef4444; color: #fff;
            font-size: 0.95rem; font-weight: 700; cursor: pointer; font-family: inherit;
            display: flex; align-items: center; justify-content: center;
            transition: background-color 0.25s cubic-bezier(0.4,0,0.2,1);
        }
        .btn-deactivate:hover:not(:disabled) { background: #dc2626; }
        .btn-deactivate:disabled { opacity: 0.6; cursor: not-allowed; }

        /* Textarea en el modal de baja / reactivación */
        .deactivate-intro {
            color: #475569; font-size: 0.9rem; line-height: 1.55; margin: 0 0 4px;
        }
        .deactivate-textarea {
            height: auto; min-height: 80px; resize: vertical; padding-top: 10px;
        }

        /* Grupo "Dado de baja" en panel admin */
        .users-group.deactivated .users-group-title { color: #94a3b8; }

        /* Motivo de baja visible en fila del admin */
        .user-deactivate-reason {
            font-size: 0.76rem; color: #64748b; margin-top: 5px;
            font-style: italic; line-height: 1.4;
        }
        .user-deactivate-reason strong { color: #94a3b8; font-style: normal; }

        /* Botón reactivar */
        .btn-reactivate {
            background: rgba(99,102,241,0.14) !important;
            border-color: rgba(99,102,241,0.35) !important;
            color: #c7d2fe !important;
        }
        .btn-reactivate:hover { background: rgba(99,102,241,0.26) !important; }

        /* Botón de mensaje directo admin → usuario */
        .btn-admin-msg {
            background: rgba(59,130,246,0.14); border: 1px solid rgba(59,130,246,0.35);
            color: #93c5fd; border-radius: 8px;
            width: 38px; height: 38px; font-size: 1rem;
            cursor: pointer; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
            transition: background-color 0.2s ease;
        }
        .btn-admin-msg:hover { background: rgba(59,130,246,0.28); }

        /* ── MODAL DE CONFIRMACIÓN ─────────────────────────────── */
        .confirm-overlay {
            position: fixed; inset: 0; z-index: 10000;
            background: rgba(15,23,42,0.75);
            display: flex; align-items: center; justify-content: center;
            opacity: 0; pointer-events: none;
            transition: opacity 0.2s ease;
        }
        .confirm-overlay.active { opacity: 1; pointer-events: auto; }
        .confirm-box {
            background: #fff; border-radius: 14px;
            padding: 28px 24px; max-width: 360px; width: 90%;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            transform: scale(0.95);
            transition: transform 0.2s ease;
            text-align: center;
        }
        .confirm-overlay.active .confirm-box { transform: scale(1); }
        .confirm-ico  { font-size: 2.2rem; margin-bottom: 10px; }
        .confirm-title { color: #0f172a; font-size: 1.1rem; font-weight: 800; margin: 0 0 8px; }
        .confirm-msg   { color: #475569; font-size: 0.9rem; margin: 0 0 22px; line-height: 1.5; }
        .confirm-btns  { display: flex; gap: 10px; justify-content: center; }
        .confirm-cancel {
            flex: 1; background: #f1f5f9; border: 1px solid #cbd5e1;
            color: #475569; border-radius: 10px; padding: 10px 0;
            font-weight: 700; font-size: 0.95rem; cursor: pointer; font-family: inherit;
        }
        .confirm-cancel:hover { background: #e2e8f0; }
        .confirm-ok {
            flex: 1; background: #ef4444; border: none;
            color: #fff; border-radius: 10px; padding: 10px 0;
            font-weight: 700; font-size: 0.95rem; cursor: pointer; font-family: inherit;
        }
        .confirm-ok:hover { background: #dc2626; }

        /* ══════════════════════════════════════════════════════
           PANEL ADMIN — MÓVIL
           Optimizado para gestión rápida desde el teléfono
           ══════════════════════════════════════════════════════ */
        @media (max-width: 767px) {

            /* ── Orden de pestañas para admin:
               Resumen → Denuncias → Usuarios → Moderación → Mis datos → Contraseña → CMS */
            body.is-admin .dash-tab[data-tab="resumen"]   { order: 1; }
            body.is-admin .dash-tab[data-tab="allchats"]  { order: 2; }
            body.is-admin .dash-tab[data-tab="users"]     { order: 3; }
            body.is-admin .dash-tab[data-tab="mod"]       { order: 4; }
            body.is-admin .dash-tab[data-tab="datos"]     { order: 5; }
            body.is-admin .dash-tab[data-tab="pass"]      { order: 6; }
            body.is-admin .dash-tab[data-tab="cms"]       { order: 7; }

            /* ── Encabezado de sección: compacto y sin descripción larga ── */
            body.is-admin .admin-card h3 {
                font-size: 1rem; margin-bottom: 10px;
            }
            body.is-admin .admin-card > p.dash-empty {
                font-size: 0.82rem; margin-bottom: 10px;
            }

            /* ── USUARIOS: fila compacta ────────────────────────────────
               Móvil muestra: avatar + nombre + estado + botón bloquear
               Se ocultan email, teléfono, dirección y rol               */
            body.is-admin .user-row {
                padding: 10px 12px;
                align-items: center;
                gap: 10px;
            }
            body.is-admin .user-detail { display: none; }
            body.is-admin .user-avatar {
                width: 36px; height: 36px;
                font-size: 0.82rem; flex-shrink: 0;
            }
            body.is-admin .user-name {
                font-size: 0.88rem; flex-wrap: nowrap;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            }
            body.is-admin .user-status {
                display: none;   /* el botón de bloqueo ya indica el estado */
            }
            body.is-admin .btn-toggle-block {
                padding: 8px 12px; font-size: 0.78rem;
                min-height: 38px; white-space: nowrap; flex-shrink: 0;
            }
            body.is-admin .users-group-title {
                font-size: 0.74rem; padding-bottom: 6px;
            }

            /* ── MODERACIÓN: item compacto ──────────────────────────────
               Móvil muestra: badge tipo + nombre del producto + botón eliminar
               Se ocultan usuario, ubicación y fecha                     */
            body.is-admin .mod-item {
                padding: 10px 12px; gap: 10px; align-items: center;
            }
            body.is-admin .mod-meta,
            body.is-admin .mod-date { display: none; }
            body.is-admin .mod-prod {
                font-size: 0.9rem;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            }
            body.is-admin .mod-badge { font-size: 0.62rem; padding: 4px 8px; }
            body.is-admin .mod-del {
                width: 42px; height: 42px; font-size: 1.05rem; flex-shrink: 0;
            }

            /* ── CONVERSACIONES: fila compacta ──────────────────────────
               En móvil se agrandan los botones de acción                */
            body.is-admin .chat-row {
                padding: 10px 12px; gap: 8px;
            }
            body.is-admin .chat-row .cr-top {
                font-size: 0.88rem;
            }
            body.is-admin .chat-row .cr-sub {
                font-size: 0.76rem; max-width: 100%;
            }
            body.is-admin .cr-btn {
                padding: 8px 12px; font-size: 0.76rem; min-height: 36px;
            }
            body.is-admin .chat-row.flagged {
                background: rgba(239,68,68,0.08);
            }

            /* ── RESUMEN ADMIN en móvil: grid 2x2 más compacto ─────── */
            body.is-admin .resumen-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
            body.is-admin .resumen-card {
                min-height: 88px; padding: 14px 12px 12px;
            }
            body.is-admin .resumen-card .rc-num {
                font-size: 1.6rem;
            }
            body.is-admin .resumen-card .rc-label {
                font-size: 0.78rem;
            }
            /* Tarjeta de denuncias: resalta si hay pendientes */
            body.is-admin .resumen-card.alert {
                border-left-color: #ef4444;
                background: rgba(239,68,68,0.1);
            }
        }

        /* ── SKELETON DE CARGA ──────────────────────────────── */
        .skeleton-list { display: flex; flex-direction: column; gap: 10px; }
        .skeleton-item {
            background: rgba(255,255,255,0.04);
            border-radius: 8px; padding: 14px;
            display: flex; flex-direction: column; gap: 8px;
        }
        .skeleton-line {
            height: 12px; border-radius: 6px;
            background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.4s infinite;
        }
        .skeleton-line.w-60  { width: 60%; }
        .skeleton-line.w-80  { width: 80%; }
        .skeleton-line.w-40  { width: 40%; }
        @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
        @media (prefers-reduced-motion: reduce) {
            .skeleton-line { animation: none; background: rgba(255,255,255,0.08); }
        }

        /* ── BOTÓN VER MÁS (paginación) ────────────────────── */
        .btn-load-more {
            display: block; width: 100%; max-width: 360px;
            margin: 20px auto 8px; padding: 12px 24px;
            background: rgba(255,255,255,0.07);
            border: 1px solid rgba(255,255,255,0.18);
            border-radius: var(--radius-md); color: #cbd5e1;
            font-size: 0.95rem; font-weight: 700; cursor: pointer;
            font-family: inherit;
            transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .btn-load-more:hover  { background: rgba(255,255,255,0.12); color: #fff; }
        .btn-load-more:disabled { opacity: 0.5; cursor: default; }

        /* ── TOAST DE NOTIFICACIONES ───────────────────────── */
        .ht-toast-container {
            position: fixed; bottom: calc(80px + env(safe-area-inset-bottom));
            right: 16px; z-index: 9999;
            display: flex; flex-direction: column; gap: 8px;
            pointer-events: none;
        }
        @media (min-width: 768px) {
            .ht-toast-container { bottom: 24px; }
        }
        .ht-toast {
            display: flex; align-items: flex-start; gap: 10px;
            background: #1e293b; color: #f1f5f9;
            border: 1px solid rgba(255,255,255,0.1);
            border-left: 4px solid #64748b;
            border-radius: 10px; padding: 12px 16px;
            font-size: 0.88rem; font-weight: 600; line-height: 1.4;
            box-shadow: 0 8px 24px rgba(0,0,0,0.4);
            max-width: 320px; pointer-events: auto;
            animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }
        .ht-toast.error  { border-left-color: #ef4444; background: #1c1010; }
        .ht-toast.ok     { border-left-color: #22c55e; background: #0f1c12; }
        .ht-toast.warn   { border-left-color: #f59e0b; background: #1c1800; }
        .ht-toast .t-ico { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
        .ht-toast.hide   { animation: toastOut 0.25s ease forwards; }
        @keyframes toastIn  { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }
        @keyframes toastOut { from { opacity:1; transform:translateX(0); }    to { opacity:0; transform:translateX(30px); } }
