
[hidden] { display: none !important; }

.d-none { display: none !important; }


.grabando {color:green;}
.grabando svg {
    color: #28a745 !important;
    transform: scale(1.1); /* Opcional: un pequeño soplido de tamaño para notar que está activo */
    transition: all 0.2s ease;
}
.texto-tachado {
    text-decoration: line-through;
    text-decoration-color: #ff0000;
    /*color: #999; /* Opcional: un tono grisáceo suele quedar muy bien para reforzar que está "anulado" */
}

#spanrefresh {color:red;}


/* Estado activo del modo súper */
.modo-super-activo svg {
    color: #0d6efd !important; /* Azul Bootstrap (o el color que te guste) */
    animation: pulso-recarga 2s infinite ease-in-out;
}

@keyframes pulso-recarga {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}



/* =========================================
   1. RESET Y ESTRUCTURA BASE (LAYOUT)
   ========================================= */
:root {
    --primary-color: #6c196a;
    --drawer-width: 260px;
    --header-height: 60px;
    --footer-height: 35px;
    --bg-light: #f4f4f4;
}

* {
    box-sizing: border-box;
}

/* El círculo que gira */
.loader {
  width: 20px;
  height: 20px;
  border: 3px solid #FFF;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Estado deshabilitado del botón */
.btn-loading {
  opacity: 0.8;
  cursor: not-allowed;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.admin-only {
    display: none !important; /* Se muestra solo si IS_ADMIN es true */
}
.admin-only.is-visible {
    display: block !important;
}
.completada {
    display:none;
}
.completada.is-visible {
    display:block;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden; /* Evita scroll en el body para que lo haga el contenedor principal */
    display: flex;
    flex-direction: column;
    /* Desactiva el efecto de rebote y la línea de color de Chrome al tirar hacia abajo */
    overscroll-behavior-y: contain;
}

/* =========================================
   2. CABECERA (HEADER)
   ========================================= */
#main-header {
    background: var(--primary-color);
    color: white;
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#header-main-nav, #header-back-nav {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
}

#header-title, #header-subtitle {
    font-size: 1.2rem;
    font-weight: bold;
    flex-grow: 1;
    margin-left: 15px;
}

/* =========================================
   3. MENÚ LATERAL (DRAWER) MEJORADO
   ========================================= */
#side-menu {
    position: fixed;
    left: calc(-1 * var(--drawer-width));
    top: 60px;
    width: var(--drawer-width);
    height: calc(100% - 60px);
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    z-index: 100;
}

#side-menu.open {
    transform: translateX(var(--drawer-width));
}

/* BANNER SUPERIOR DEL MENÚ */
.menu-banner {
    width: 100%;
    height: 150px;
    background-image: url('./images/xfondoimagenheader.png');
    /* Opcional: para que se ajuste bien al rectángulo de 500x350 */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 15px;
}

.menu-user-info {
    color: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.menu-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid white;
}

/* LISTA DE OPCIONES */
#side-menu ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

#side-menu li {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
}

#side-menu li:active {
    background-color: #f0f0f0;
}

/* ICONOS */
.icon {
    margin-right: 15px;
    font-size: 1.2rem;
    width: 24px; /* Ancho fijo para que el texto esté alineado */
    text-align: center;
}
.lucide {
    margin-right: 15px;
    font-size: 1.2rem;
    width: 24px; /* Ancho fijo para que el texto esté alineado */
    text-align: center;
}
/* DIVISOR MANUAL */
.menu-divider {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

#overlay {
    display: none; /* Se activa por JS */
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: rgba(0,0,0,0.3); /* Un gris muy suave para dar profundidad */
    z-index: 90; /* Por debajo del menú (100) pero sobre el contenido */
    cursor: pointer;
}

/* =========================================
   4. SUBMENÚ (LOS TRES PUNTOS)
   ========================================= */
.dropdown {
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    min-width: 150px;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}

.submenu.show {
    display: flex;
}

.submenu button {
    background: white;
    border: none;
    padding: 12px 15px;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    color: #333;
    width: 100%; /* Asegura que el área de clic ocupe todo el ancho */
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0; /* Separación sutil entre opciones */
}
.submenu button:last-child {
    border-bottom: none; /* El último botón no necesita raya */
}

.submenu button:active {
    background-color: #f5f5f5; /* Efecto visual al tocar (feedback táctil) */
}

.submenu button:hover {
    background: #f0f0f0;
}

/* =========================================
   5. CONTENIDO PRINCIPAL (SCROLLABLE)
   ========================================= */
#app-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--bg-light);
    -webkit-overflow-scrolling: touch;
}

/* =========================================
   6. FOOTER FIJO
   ========================================= */
#main-footer {
    background-color: #fff;
    border-top: 1px solid #ddd;
    height: var(--footer-height);
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 0.75rem;
    color: #666;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
}


.page.active {
    display: block; /* Solo la que tenga la clase 'active' se ve */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* Añade esto a tu archivo CSS */
.page {
    display: none;
    padding: 15px;
    box-sizing: border-box; /* Fundamental para que el padding no rompa el ancho */
    width: 100%;
    min-height: 100%;
    animation: fadeIn 0.3s; /* Un toque de elegancia */
    padding-bottom: 80px; /* Suficiente espacio para que el FAB no moleste al contenido final */

}

/* El estilo exclusivo para tu footer interno */
.section-footer {
    position: absolute;
    bottom: var(--footer-height);
    left: 0;
    width: 100%;
    height: 50px; /* Alto de tu barra de iconos */
    background: #f8f9fa;
    border-top: 1px solid #eaeaea;
    z-index: 10; /* Se asegura de quedar por encima del contenido que hace scroll */

    /* Distribución horizontal de los iconos de Lucide */
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-sizing: border-box;
}


/* Para los formularios en móviles, que no se peguen a los bordes */
input, select, textarea {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px; /* Evita que iOS haga zoom automático al enfocar */
}

/* Botón Flotante Base */
.fab {
    
    
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff; /* Color primario de tu app */
    color: white;
    border: none;
    box-shadow: 0 3px 5px -1px rgba(0,0,0,0.2), 
                0 6px 10px 0 rgba(0,0,0,0.14), 
                0 1px 18px 0 rgba(0,0,0,0.12);
    font-size: 24px;
    
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900; /* Por debajo del menú lateral, pero sobre el contenido */
    transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab, .fab-extended {
    position: fixed;
    /* Sumamos el margen deseado (20px) + la altura del footer */
    bottom: calc(var(--footer-height) + 20px); 
    right: 20px;
    z-index: 900;
    display: none;
}

.fab:active {
    transform: scale(0.9); /* Efecto de pulsación */
    background-color: #0056b3;
    box-shadow: 0 5px 5px -3px rgba(0,0,0,0.2), 
                0 8px 10px 1px rgba(0,0,0,0.14), 
                0 3px 14px 2px rgba(0,0,0,0.12);
}
/* Estilo para el FAB Extendido */
.fab-extended {
    width: auto;           /* Quita el ancho fijo de 60px */
    height: 48px;          /* Un poco más bajo que el circular suele quedar mejor */
    padding: 0 20px;       /* Espacio a los lados del texto */
    border-radius: 24px;   /* Mitad de la altura para bordes redondeados */
    gap: 10px;             /* Espacio entre el icono y el texto */
    font-weight: 500;      /* Letra un poco más gruesa */
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase; /* Estilo clásico de Material Design */
}

.page.active .fab, .page.active .fab-extended {
    animation: bounceIn 0.5s;
    display: flex;
}

@keyframes bounceIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}



/* Asegura que el contenedor de la sección no deje salir nada */
#section-video-player {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.video-layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%; /* Mejor que 100vw para evitar problemas con scrollbars */
    height: 100%; /* Mejor que 100vh en móviles */
    background: #000;
    display: flex;
    flex-direction: column;
}

#youtube-player {
    flex: 1; /* Ocupa el espacio restante sin empujar hacia fuera */
    width: 100%;
    height: 0; /* Truco de Flexbox: fuerza a que la altura crezca desde 0 hasta el máximo disponible */
}

#youtube-player iframe {
    width: 100% !important;
    height: 100% !important;
    display: block;
}






.ficha-video {
    border: 1px solid #ccc; 
    padding: 10px; 
    margin-bottom: 10px; 
    border-radius: 8px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}





/* La botonera: en línea y debajo del video */
.video-controls {
    /* Quitamos position: absolute para que fluya después del video */
    width: 100%;
    display: flex;
    flex-direction: row; /* Todos los botones en línea */
    flex-wrap: wrap; /* Por si son muchos y no caben en móviles pequeños */
    justify-content: space-evenly;
    align-items: center;
    gap: 10px;
    padding: 10px 5px;
    background: #111; /* Un gris muy oscuro para diferenciar de la zona de video */
    z-index: 20;
}
.video-controls button {
    /*padding: 10px 15px;*/
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap; /* Evita que el texto del botón se parta */
}
.video-controls button {
    padding: 8px 12px;
    font-size: 0.9rem;
}
/* Mensajes de estado (flotando sobre el video) */
#status-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    z-index: 15;
}

.editor-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
}

.ficha-traduccion {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #ccc;
}

.badge-clave {
    font-family: monospace;
    font-size: 0.8rem;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    color: #666;
    display: inline-block;
    max-width: 100%;
    white-space: normal;      /* Permite el flujo normal */
    overflow-wrap: break-word; /* Fuerza la ruptura de palabras largas */
    word-break: break-all;
}

.campo {
    margin-top: 12px;
}

.campo label {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.texto-referencia {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    font-style: italic;
    color: #555;
    border: 1px dashed #ddd;
}

.editable-ca {
    background: #fff;
    border: 1px solid var(--primary-color);
    padding: 10px;
    border-radius: 4px;
    min-height: 40px;
    line-height: 1.4;
}

.status-save {
    font-size: 0.7rem;
    height: 1rem;
    margin-top: 4px;
    text-align: right;
    transition: color 0.3s;
}

.status-save.success {
    color: green;
    font-weight: bold;
}

.grid-calendario {
    display: grid;
    /* Creamos una rejilla de cuadrados pequeños */
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    gap: 4px; /* Espacio mínimo entre "días/ejercicios" */
    margin: 15px 0;
}

.celda-ejercicio {
    aspect-ratio: 1 / 1; /* Asegura que sean cuadrados perfectos */
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 0.65rem;
    font-weight: bold;
    transition: transform 0.1s;
}

/* Colores de estado */
.celda-hecho {
    /*background-color: #28a745;*/
    color:#28a745;
}

.celda-pendiente {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Icono dentro de la celda */
.celda-ejercicio i {
    width: 18px;
    height: 18px;
}
.celda-ejercicio svg.lucide {
    margin-right: 0 !important;
    margin-left: 0 !important;
    display: block; /* Ayuda a centrarlo mejor si es el único elemento */
}


/* Leyenda inferior */
.dot {
    height: 8px;
    width: 8px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 4px;
}
.rojo { background-color: #dc3545; }
.verde { background-color: #28a745; }
.config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5px;
    min-height: 50px;
}

.config-row.clickable:active {
    background-color: rgba(0,0,0,0.05);
}

.config-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-label i {
    width: 20px;
    height: 20px;
    color: #555;
}
.config-label i {
    flex-shrink: 0; /* Evita que el icono se aplaste si el texto es largo */
}

.config-text {
    display: flex;
    flex-direction: column; /* Esto fuerza el salto de línea interno */
    line-height: 1.2;       /* Ajusta el espacio entre líneas */
}

.config-text small {
    font-size: 0.8rem;
    color: #888;           /* Un tono más suave para la nota */
    margin-top: 2px;
}

.text-danger {
    color: #d9534f;
}

.text-danger i {
    color: #d9534f;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 0;
}

/* El contenedor del switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

/* Ocultar el checkbox original */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* El slider (fondo) */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

/* Color cuando está activo (ajusta a tu color principal) */
input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

/* Movimiento del círculo */
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Redondear bordes */
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}


.titulo-con-botones {
    display: flex;
    justify-content: space-between; /* Empuja los elementos a los extremos */
    align-items: center;            /* Los centra verticalmente */
    width: 100%;
}

/* Opcional: si el de la derecha es un icono o botón pequeño */
.actualizar-derecha {
    font-size: 0.8rem;
    font-weight: normal;
    display:none;
}



/* Un poco de estilo rápido para el look PWA */
.user-card {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #eaeaea;
}

/* Columna Izquierda (El Checkbox) */
.user-card input[type="checkbox"] {
    flex: 0 0 40px;       /* No crece, no encoge, ocupa siempre 40px */
    width: 20px;
    height: 20px;
}

.user-card input[type="radio"] {
    flex: 0 0 40px;       /* No crece, no encoge, ocupa siempre 40px */
    width: 20px;
    height: 20px;
}

/* Columna Derecha (Los Datos) */
.user-info {
    flex: 1;              /* Ocupa todo el espacio restante */
    display: flex;
    flex-direction: column;
    gap: 4px;             /* Espacio entre el código y las estadísticas */
}

.user-code {
    font-size: 1rem;
    font-weight: bold;
    color: #2c3e50;
}

.user-stats {
    display: flex;
    align-items: center;
    height: 100%; /* Asegura que ocupe el alto del padre si es necesario */
}

/* Evitamos que el tamaño de fuente pequeño desajuste la altura de línea */
.user-stats span {
    line-height: 1; 
    display: inline-block;
}

.user-stats div {
    font-size: 0.8rem;
    color: #7f8c8d;
    /*display: flex;
    flex-wrap: wrap;      
    gap: 10px;*/
}



.product-card {
    display: flex;
    align-items: center; /* Alinea verticalmente las dos columnas al centro */
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #eaeaea;
}

/* Columna Izquierda: Centrado estricto del radio */
.product-card-left {
    flex: 0 0 40px;       /* Ancho fijo de 40px para la zona del input */
    display: flex;
    align-items: center;  /* Centra el radio verticalmente */
}

.product-card-left input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;            /* Quitamos márgenes por defecto del navegador */
}

/* Columna Derecha: Ocupa todo el resto */
.product-card-right {
    flex: 1;
}

.product-info {
    display: flex;
    flex-direction: column;
    /*gap: 4px;*/
}

/* 1. ESTADO NORMAL: El círculo vacío */
.checkbox__input {
    
    width: 20px; height: 20px;
    margin: 0; padding: 0; border: 0;
    z-index: 1;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;

    /* Creamos el círculo visual */
    background-color: #fff;
    border: 2px solid #ccc !important; /* Borde gris redondo */
    border-radius: 50%; /* Esto lo hace perfectamente circular */
    box-sizing: border-box;
    transition: all 0.2s ease;
    position:relative;
}

/* 2. ESTADO SELECCIONADO (CHECKED): Se vuelve azul con el "tick" */
.checkbox__input:checked {
    background-color: #007aff; /* El azul nativo/profesional de PWA */
    border-color: #007aff !important;
}

/* 3. EL MÁGICO "TICK" BLANCO DE SELECCIÓN */
/* Usamos un pseudoelemento para dibujar la marca de verificado sin cargar imágenes */
.checkbox__input:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}





.btn-primary-notif {
    background: #007bff; color: white; border: none;
    padding: 10px 20px; border-radius: 20px; cursor: pointer;
}

.btn-primary-notif:disabled { background: #ccc; }

.check-container-notif {
    display: inline-flex;
    align-items: center;  /* Centra verticalmente el check con el texto */
    gap: 10px;            /* Espacio entre el cuadro y el texto */
    cursor: pointer;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #ddd;
    user-select: none;    /* Evita que se seleccione el texto al hacer clic */
}

.check-container-notif input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;            /* Quita márgenes extraños del navegador */
    cursor: pointer;
}

.label-text-notif {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.notif-actions-bar {
    display: flex;
    align-items: center;      /* Alineación vertical perfecta */
    justify-content: space-between; /* Opción A: uno a cada lado */
    /* justify-content: flex-start;  Opción B: los dos a la izquierda */
    gap: 15px;                /* Espacio real entre el label y el botón */
    margin-bottom: 20px;      /* Separación con la lista de abajo */
    padding: 10px 0;
}

/* Ajuste fino para que ambos midan lo mismo visualmente */
.btn-primary-notif, 
.check-container-notif {
    height: 42px;             /* Forzamos la misma altura para ambos */
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;   /* Evita que el padding sume al alto total */
}

.btn-primary-notif {
    /* Mantén tus estilos y añade estos para asegurar el centrado del texto */
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.mensaje-container {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
}

#mensaje-push {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    /* 'both' permite redimensionar horizontal y verticalmente */
    /* 'vertical' es más común para no romper el diseño lateral */
    resize: vertical; 
}

.resultado-push {
    border: 2px solid #007bff;
    background-color: #f0f8ff;
    font-size: 1rem;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}





.welcome {
  padding: 1.5rem;
  line-height: 1.6;
}

.welcome h1 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.welcome h2 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.welcome .intro {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.welcome .key-points {
  list-style: none;
  padding-left: 0;
}

.welcome .key-points li {
  margin-bottom: 0.75rem;
}

.welcome .key-points li::before {
  content: "• ";
  color: #666;
}

.welcome .highlight {
  margin-top: 1.5rem;
  font-weight: 500;
}


/* Contenedor principal de la sección */
#seccion-alta-manual {
    padding: 15px;
    box-sizing: border-box;
}

/* El bloque del texto */
.grupo-formulario {
    margin-bottom: 15px;
}

.etiqueta-formulario {
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

#texto-productos {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    resize: vertical; /* Permite estirar hacia abajo si se necesita */
}

/* Botón de grabar manual (Estilo bloque que ocupa todo el ancho) */
#btn-grabar-manual {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Espacio entre el icono de Lucide y el texto */
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background-color: #0d6efd; /* Tu color corporativo o el azul que quieras */
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#btn-grabar-manual:active {
    background-color: #0b5ed7; /* Efecto al pulsar en el móvil */
}



.pantalla-config {
    padding: 15px;
    box-sizing: border-box;
    max-width: 600px;
    margin: 0 auto;
}

.bloque-config {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.bloque-config h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}

/* Filas informativas */
.fila-info {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
}
.texto-corto {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #777;
}
.badge-online {
    background: #d4edda;
    color: #155724;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}
.badge-offline {
    background: #d80b0b;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}
/* Campos de Formulario */
.campo-config {
    margin-bottom: 10px;
}
.campo-config label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 3px;
}
.campo-config input, .campo-config select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Botonera */
.btn-lineal {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
}
.btn-lineal:active { background: #e2e6ea; }

.btn-guardar {
    width: 100%;
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.zona-peligro { border-color: #f5c6cb; }
.btn-peligro { color: #dc3545; background: #fff5f5; border-color: #f5c6cb; }
.btn-peligro:active { background: #f8d7da; }
.btn-destacado { color: #0d6efd; background: #f0f7ff; border-color: #b6d4fe; }

/* --- SWITCH ON/OFF ESTILO IOS --- */
.fila-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.slider-round:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider-round { background-color: #28a745; }
input:checked + .slider-round:before { transform: translateX(24px); }


/* Capa de fondo que cubre la pantalla */
.capa-carga {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85); /* Fondo blanco semitransparente */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Por encima de todo, incluso del footer */
    gap: 15px;
    font-family: sans-serif;
    font-weight: bold;
    color: #333;
}

/* El círculo giratorio */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd; /* Tu color azul */
    border-radius: 50%;
    animation: girar 1s linear infinite;
}

@keyframes girar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Clase utilitaria para ocultar/mostrar */
.oculto {
    display: none !important;
}


.pantalla-comunidades {
    padding: 15px;
    box-sizing: border-box;
    max-width: 600px;
    margin: 0 auto;
}

.categoria-comunidades h2 {
    font-size: 1.1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 6px;
}

/* Tarjeta de cada comunidad */
.tarjeta-comunidad {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.tarjeta-comunidad h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #0d6efd;
}

/* Listado de miembros */
.lista-miembros {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fila-miembro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.95rem;
}

.fila-miembro:last-child {
    border-bottom: none;
}

/* Badge de Propietario / Master */
.badge-master {
    background: #fff3cd;
    color: #856404;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* Botón Abandonar */
.btn-abandonar {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: #fff5f5;
    color: #dc3545;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-abandonar:active { background: #f8d7da; }

/* --- REUTILIZAMOS EL SWITCH ON/OFF DE IOS --- */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #28a745; /* On por defecto porque "están" en la comunidad */
    transition: .3s;
    border-radius: 22px;
}
.slider-round:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    transform: translateX(22px); /* Posición ON por defecto */
}
/* Cuando se desmarca, cambia a gris */
input:not(:checked) + .slider-round { background-color: #ccc; }
input:not(:checked) + .slider-round:before { transform: translateX(0px); }

.mt-4 { margin-top: 1.5rem; }


.cabecera-tarjeta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.tarjeta-comunidad h3 {
    margin: 0;
    font-size: 1rem;
    color: #0d6efd;
    word-break: break-word; /* Por si el email del nombre es muy largo */
}

.acciones-tarjeta {
    display: flex;
    gap: 8px; /* Separación entre el lápiz y la papelera */
}

.btn-icono {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icono-edit { color: #0d6efd; }
.btn-icono-edit:active { background: #e6f0ff; }

.btn-icono-trash { color: #dc3545; }
.btn-icono-trash:active { background: #ffe6e6; }
