/* VARIABLES MATERIAL DESIGN 3 */
:root {
    --md-primario: #006c4c;
    --md-on-primario: #ffffff;
    --md-primario-contenedor: #89f8c7;
    --md-fondo: #fbfdf9;
    --md-superficie: #ffffff;
    --md-superficie-variante: #dce5dd;
    --md-error: #ba1a1a;
    --md-borde: #717971;
    --md-texto: #191c1a;
    --md-sombra: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --md-sombra-alta: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

/* RESET GENERAL */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body { 
    font-family: 'Segoe UI', Roboto, sans-serif; 
    background-color: var(--md-fondo); 
    color: var(--md-texto);
    line-height: 1.5;
    overflow-x: hidden;  /* evita scroll horizontal en móvil */
}

/* --- ESTILOS DE ACCESO (LOGIN) --- */
.pantalla-acceso {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
    max-width: 100vw;
}

.tarjeta-login {
    display: grid;
    gap: 24px;
    background: var(--md-superficie);
    padding: 40px;
    border-radius: 28px;
    box-shadow: var(--md-sombra-alta);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.formulario-pila {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.campo-entrada {
    position: relative;
    display: flex;
    flex-direction: column;
}

.campo-entrada input {
    height: 56px;
    border: 1px solid var(--md-borde);
    border-radius: 8px;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
}

.campo-entrada input:focus {
    border: 2px solid var(--md-primario);
}

/* --- ESTILOS DEL ESCRITORIO (DASHBOARD) --- */
.layout-escritorio {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Menú Lateral */
.menu-lateral {
    background-color: var(--md-superficie);
    border-right: 1px solid var(--md-superficie-variante);
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.cabecera-logo {
    padding: 24px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    color: var(--md-primario);
    font-size: 1.2rem;
}

.navegacion {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.enlace-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--md-texto);
    border-radius: 28px;
    transition: background 0.2s;
}

.enlace-nav:hover { background: var(--md-superficie-variante); }
.enlace-nav.activo {
    background: var(--md-primario-contenedor);
    color: var(--md-primario);
    font-weight: 600;
}

/* Contenido Principal */
.contenedor-principal {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.barra-superior {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avatar-usuario {
    width: 40px;
    height: 40px;
    background: var(--md-primario);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Rejillas con CSS Grid */
.rejilla-metricas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.tarjeta-metrica {
    background: var(--md-superficie);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--md-sombra);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.etiqueta-metrica { font-size: 0.75rem; color: var(--md-borde); font-weight: bold; }
.valor-metrica { font-size: 2rem; font-weight: bold; color: var(--md-primario); }

.seccion-datos {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.tarjeta-contenedor {
    background: var(--md-superficie);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--md-sombra);
}

/* Tablas */
.tabla-scroll { overflow-x: auto; margin-top: 16px; }
.tabla-material {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.tabla-material th { padding: 12px; border-bottom: 2px solid var(--md-superficie-variante); color: var(--md-borde); font-size: 0.85rem; }
.tabla-material td { padding: 16px 12px; border-bottom: 1px solid var(--md-superficie-variante); }

/* Píldoras */
.pildora-estado { padding: 4px 12px; border-radius: 12px; font-size: 0.75rem; font-weight: bold; }
.pildora-estado.pagado { background: #e6f4ea; color: #1e8e3e; }
.pildora-estado.pendiente { background: #fce8e6; color: #d93025; }

/* Botón Flotante (FAB) */
.boton-flotante {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--md-primario);
    color: #ffffff;
    border: none;
    box-shadow: var(--md-sombra-alta);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}
.boton-flotante:hover  { opacity: 0.88; transform: scale(1.05); }
.boton-flotante:active { transform: scale(0.97); }

/* --- PUNTOS DE RUPTURA (RESPONSIVE) --- */

@media (max-width: 1024px) {
    .layout-escritorio { grid-template-columns: 80px 1fr; }
    .texto-menu { display: none; }
    .cabecera-logo { justify-content: center; padding: 24px 0; }
}

@media (max-width: 800px) {
    .seccion-datos { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    /* El aside sale del flujo → el grid solo necesita 1 columna */
    .layout-escritorio {
        display: block;          /* block en vez de grid elimina la columna fantasma */
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .menu-lateral {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 900;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        width: 260px;
        max-width: 80vw;
        box-shadow: 4px 0 20px rgba(0,0,0,0.18);
        overflow-y: auto;
    }
    .menu-lateral.abierto { transform: translateX(0); }
    .contenedor-principal {
        padding: 16px;
        padding-top: 68px;   /* alto barra 56px + 12px respiro */
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .barra-movil { display: flex !important; }
    /* Ocultar etiquetas de texto del menú lateral en móvil (ya estaban ocultas en 1024) */
    .texto-menu { display: inline; }
}

@media (max-width: 480px) {
    /* padding-top lo maneja ya el bloque 600px */
    .valor-metrica { font-size: 1.5rem; }
    .barra-superior h1 { font-size: 1.2rem; }
    .rejilla-metricas { gap: 12px; }
    .tarjeta-metrica { padding: 16px; }
}
/* --- ETIQUETA CAMPOS FORMULARIO (accesibilidad) --- */
.etiqueta-campo {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--md-borde);
    margin-bottom: 4px;
    text-align: left;
}

/* --- BOTÓN PRINCIPAL --- */
.boton-ejecutar {
    height: 56px;
    background: var(--md-primario);
    color: var(--md-on-primario);
    border: none;
    border-radius: 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 0.05em;
}
.boton-ejecutar:hover  { opacity: 0.9; }
.boton-ejecutar:active { transform: scale(0.98); }

/* Mensaje de error en formulario */
#mensaje-error {
    padding: 10px 14px;
    border-radius: 8px;
    background: #fce8e6;
    color: var(--md-error);
    font-size: 0.9rem;
    text-align: left;
}

/* --- GRÁFICA DONUT SVG PURA --- */
:root {
    --md-error-claro: #fce8e6;
}

.grafica-donut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.svg-donut {
    width: 180px;
    height: 180px;
}

.donut-label-num {
    font-size: 18px;
    font-weight: 700;
    fill: var(--md-primario);
}

.donut-label-txt {
    font-size: 9px;
    fill: var(--md-borde);
}

.leyenda-donut {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.leyenda-item { display: flex; align-items: center; gap: 8px; }
.leyenda-item.pagado  { color: var(--md-primario); }
.leyenda-item.pendiente { color: var(--md-error); }

/* --- RESPONSIVE MÓVIL EXTRA --- */
@media (max-width: 480px) {
    .tarjeta-login { padding: 28px 20px; }
}

/* ================================================================
   CRUD DE ASOCIADOS
   ================================================================ */

/* Barra superior con botón */
.acciones-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Botones */
.boton-primario {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--md-primario);
    color: var(--md-on-primario);
    border: none;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}
.boton-primario:hover { opacity: 0.88; }

.boton-secundario {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    color: var(--md-primario);
    border: 2px solid var(--md-primario);
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.boton-secundario:hover { background: var(--md-superficie-variante); }

.boton-peligro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--md-error);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.boton-peligro:hover { opacity: 0.88; }

/* Barra de filtros */
.barra-filtros {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.campo-busqueda {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}
.campo-busqueda i {
    position: absolute;
    left: 14px;
    color: var(--md-borde);
}
.campo-busqueda input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 42px;
    border: 1px solid var(--md-borde);
    border-radius: 22px;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s;
}
.campo-busqueda input:focus { border-color: var(--md-primario); }

.barra-filtros select {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--md-borde);
    border-radius: 22px;
    font-size: 0.9rem;
    background: var(--md-superficie);
    cursor: pointer;
    outline: none;
}

/* Tabla panel */
.tabla-panel { min-height: 300px; }

.estado-carga, .estado-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--md-borde);
    text-align: center;
}
.estado-carga[hidden], .estado-vacio[hidden] { display: none !important; }

.col-acciones { width: 100px; text-align: center; }

.btn-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--md-primario);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
    text-decoration: none;
}
.btn-icono:hover { background: var(--md-superficie-variante); }
.btn-icono.peligro { color: var(--md-error); }
.btn-icono.peligro:hover { background: #fce8e6; }

/* Chip de categoría */
.chip {
    display: inline-block;
    padding: 3px 10px;
    background: var(--md-primario-contenedor);
    color: var(--md-primario);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Paginación */
.paginacion {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding-top: 20px;
    flex-wrap: wrap;
}
.btn-pag {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--md-borde);
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}
.btn-pag:hover { background: var(--md-superficie-variante); }
.btn-pag.activo {
    background: var(--md-primario);
    color: white;
    border-color: var(--md-primario);
}

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay[hidden] { display: none !important; }
.modal-caja {
    background: var(--md-superficie);
    border-radius: 20px;
    padding: 32px;
    max-width: 440px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--md-sombra-alta);
}
.modal-caja h2 { font-size: 1.1rem; color: var(--md-error); }
.modal-botones { display: flex; gap: 12px; justify-content: flex-end; }

/* ── FORMULARIO ──────────────────────────────────────── */

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--md-borde);
}
.breadcrumb a { color: var(--md-primario); text-decoration: none; }
.breadcrumb i { font-size: 0.7rem; }

/* Alertas */
.alerta {
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 600;
}
.alerta-ok    { background: #e6f4ea; color: #1e8e3e; }
.alerta-error { background: #fce8e6; color: var(--md-error); }
.aviso-info {
    padding: 16px 20px;
    background: #e8f4fd;
    color: #1565c0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tabs */
.tabs-form {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--md-superficie-variante);
}
.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--md-borde);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
    transition: all 0.2s;
}
.tab:hover { background: var(--md-superficie-variante); color: var(--md-texto); }
.tab.activo {
    color: var(--md-primario);
    background: var(--md-primario-contenedor);
    border-bottom: 2px solid var(--md-primario);
    margin-bottom: -2px;
}

/* Panel de tab */
.panel-tab {
    background: var(--md-superficie);
    border-radius: 0 16px 16px 16px;
    padding: 28px;
    box-shadow: var(--md-sombra);
}

/* Grid del formulario (12 columnas lógicas) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 16px;
}

.campo-form { display: flex; flex-direction: column; gap: 6px; }
.campo-form label { font-size: 0.82rem; font-weight: 600; color: var(--md-borde); }
.campo-form input,
.campo-form select,
.campo-form textarea {
    height: 44px;
    border: 1px solid var(--md-borde);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
    background: var(--md-superficie);
}
.campo-form textarea { height: auto; padding: 10px 12px; resize: vertical; }
.campo-form input:focus,
.campo-form select:focus,
.campo-form textarea:focus { border: 2px solid var(--md-primario); }
.campo-readonly { background: var(--md-superficie-variante); color: var(--md-borde); }

/* Spans de columna */
.col-full { grid-column: 1 / -1; }
.col-1-4  { grid-column: span 1; }
.col-2-4  { grid-column: span 2; }

/* Checkboxes de categoría */
.grupo-checks { border: 1px solid var(--md-borde); border-radius: 10px; padding: 16px; }
.grupo-checks legend { padding: 0 8px; font-size: 0.82rem; font-weight: 600; color: var(--md-borde); }
.checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    cursor: pointer;
}
.check-item input[type=checkbox] {
    width: 18px; height: 18px;
    accent-color: var(--md-primario);
    cursor: pointer;
}

/* Requerido */
.req { color: var(--md-error); }

/* Campo con icono de red social */
.campo-icono { position: relative; display: flex; align-items: center; }
.campo-icono i { position: absolute; left: 12px; color: var(--md-borde); }
.campo-icono input { padding-left: 36px; width: 100%; }

/* Fotos */
.bloque-fotos { margin-bottom: 32px; }
.bloque-fotos h3 { margin-bottom: 12px; font-size: 1rem; }
.aviso-max { font-size: 0.8rem; color: var(--md-borde); font-weight: normal; }

.galeria-fotos {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.foto-item {
    position: relative;
    width: 120px; height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--md-superficie-variante);
}
.foto-item img { width: 100%; height: 100%; object-fit: cover; }
.btn-borrar-foto {
    position: absolute;
    top: 4px; right: 4px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex; align-items: center; justify-content: center;
}

.zona-subida {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--md-borde);
    border-radius: 12px;
    color: var(--md-borde);
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    transition: all 0.2s;
    min-height: 100px;
}
.zona-subida:hover, .zona-subida.drag-over {
    border-color: var(--md-primario);
    background: var(--md-primario-contenedor);
    color: var(--md-primario);
}
.zona-subida.subiendo { opacity: 0.6; pointer-events: none; }

/* Barra de acciones inferior */
.form-acciones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

/* Estado de pago — exento */
.pildora-estado.exento { background: #fff3cd; color: #856404; }

/* ── RESPONSIVE CRUD ────────────────────────────────── */
@media (max-width: 900px) {
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .col-1-4  { grid-column: span 1; }
    .col-2-4  { grid-column: span 2; }
    .col-full { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    .barra-filtros { flex-direction: column; }
    .campo-busqueda { width: 100%; }
    .barra-filtros select { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .col-1-4, .col-2-4 { grid-column: span 1; }
    .tabs-form { gap: 2px; }
    .tab { padding: 8px 12px; font-size: 0.8rem; }
    .tab i { display: none; }
    .panel-tab { padding: 16px; }
    .form-acciones { flex-direction: column; gap: 12px; }
}

/* ── BÚSQUEDA Y ORDENACIÓN ───────────────────────────────── */

.campo-busqueda { position: relative; }
.btn-limpiar-busqueda {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--md-borde);
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
    line-height: 1;
}
.btn-limpiar-busqueda:hover { color: var(--md-error); }

.info-resultados {
    font-size: 0.85rem;
    color: var(--md-borde);
    padding: 2px 0 4px;
}

/* Cabeceras ordenables */
.th-orden {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.th-orden:hover { background: var(--md-superficie-variante); }
.th-orden.ordenado-asc  { color: var(--md-primario); }
.th-orden.ordenado-desc { color: var(--md-primario); }
.flecha-orden { font-size: 0.8rem; opacity: 0.6; }
.th-orden.ordenado-asc  .flecha-orden,
.th-orden.ordenado-desc .flecha-orden { opacity: 1; }

/* Chip multicat con ellipsis */
.chip {
    display: inline-block;
    padding: 3px 10px;
    background: var(--md-primario-contenedor);
    color: var(--md-primario);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    cursor: default;
}

/* Enlaces en tabla */
.enlace-tabla {
    color: var(--md-primario);
    text-decoration: none;
    font-size: 0.9rem;
}
.enlace-tabla:hover { text-decoration: underline; }

/* Ellipsis paginación */
.pag-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    color: var(--md-borde);
    font-size: 1rem;
}

/* ── VALIDACIONES ───────────────────────────────────────── */
.campo-error  { border-color: var(--md-error) !important; background: #fff8f7; }
.campo-ok     { border-color: #1e8e3e !important; }
.hint-validacion {
    font-size: 0.78rem;
    margin-top: 3px;
    display: block;
}
.hint-validacion.error { color: var(--md-error); }
.hint-validacion.ok    { color: #1e8e3e; }

/* ── CONFIGURACIÓN ──────────────────────────────────────── */
.cfg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 900px) { .cfg-grid { grid-template-columns: 1fr; } }

.cfg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.cfg-header h2 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--md-primario);
}
.cfg-desc {
    font-size: 0.82rem;
    color: var(--md-borde);
    margin-bottom: 14px;
}

.boton-sm { padding: 7px 16px; font-size: 0.85rem; }

.cfg-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
}
.cfg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--md-fondo);
    border: 1px solid var(--md-superficie-variante);
    transition: background 0.15s;
}
.cfg-item:hover { background: var(--md-superficie-variante); }
.cfg-item.inactivo { opacity: 0.5; }

.cfg-nombre { flex: 1; font-size: 0.92rem; }

.cfg-tag-activo,
.cfg-tag-inactivo {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.cfg-tag-activo   { background: #e6f4ea; color: #1e8e3e; }
.cfg-tag-inactivo { background: #f5f5f5; color: #9e9e9e; }

.cfg-acciones { display: flex; gap: 2px; }

.cfg-color-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.12);
}

.cfg-vacia {
    text-align: center;
    color: var(--md-borde);
    font-size: 0.9rem;
    padding: 20px;
}

/* ── RECUPERAR CONTRASEÑA ───────────────────────────────── */
.btn-link {
    background: none;
    border: none;
    color: var(--md-primario);
    font-size: 0.88rem;
    cursor: pointer;
    padding: 8px 0;
    text-decoration: underline;
    display: block;
    text-align: center;
    width: 100%;
    margin-top: 4px;
}
.btn-link:hover { opacity: 0.75; }

.texto-recuperar {
    font-size: 0.9rem;
    color: var(--md-borde);
    text-align: center;
    margin-bottom: 4px;
}

/* ── COOKIE CONSENT ─────────────────────────────────────── */
#cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 2000;
    background: rgba(25, 28, 26, 0.97);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: center;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.3);
    transition: transform 0.4s ease, opacity 0.4s ease;
}
#cookie-banner.oculto { transform: translateY(100%); opacity: 0; }

.ck-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 900px;
    width: 100%;
    flex-wrap: wrap;
}
.ck-texto { flex: 1; min-width: 200px; }
.ck-texto strong { display: block; margin-bottom: 4px; font-size: 0.95rem; }
.ck-texto p { font-size: 0.82rem; color: rgba(255,255,255,0.75); margin: 0; }
.ck-botones { display: flex; gap: 10px; flex-shrink: 0; }
.ck-btn {
    padding: 9px 20px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.ck-btn-pri { background: var(--md-primario); color: #fff; }
.ck-btn-sec { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.ck-btn:hover { opacity: 0.85; }

@media (max-width: 600px) {
    .ck-inner { flex-direction: column; gap: 12px; }
    .ck-botones { width: 100%; justify-content: stretch; }
    .ck-btn { flex: 1; text-align: center; }
}

/* ── BARRA MÓVIL Y MENÚ HAMBURGUESA ─────────────────────── */
.barra-movil {
    display: none;      /* visible solo en móvil via @media */
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: 56px;
    background: var(--md-superficie);
    border-bottom: 1px solid var(--md-superficie-variante);
    align-items: center;
    justify-content: space-between;   /* título izq, burger der */
    padding: 0 12px 0 16px;
    z-index: 800;
    box-shadow: var(--md-sombra);
}
.btn-hamburguesa {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--md-primario);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-hamburguesa:hover { background: var(--md-superficie-variante); }
.barra-movil-titulo {
    font-weight: 700;
    color: var(--md-primario);
    font-size: 1rem;
}
.overlay-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 850;
}
.overlay-menu.visible { display: block; }

/* Login responsive extras */
.btn-link {
    background: none;
    border: none;
    color: var(--md-primario);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 8px;
    text-decoration: underline;
    padding: 4px 0;
    width: 100%;
    text-align: center;
}
.texto-recuperar {
    font-size: 0.88rem;
    color: var(--md-borde);
    margin-bottom: 16px;
    text-align: center;
}
.enlace-reset-box {
    background: var(--md-fondo);
    border: 1px solid var(--md-borde);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    word-break: break-all;
    color: var(--md-texto);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 6px;
}
.btn-copiar {
    background: var(--md-primario);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── AUDITORÍA ──────────────────────────────────────────── */
.input-fecha {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--md-borde);
    border-radius: 22px;
    font-size: 0.9rem;
    background: var(--md-superficie);
    outline: none;
}
.celda-fecha { white-space: nowrap; font-size: 0.88rem; }
.celda-fecha .hora { display: block; color: var(--md-borde); font-size: 0.8rem; }
.celda-ip { font-size: 0.8rem; color: var(--md-borde); font-family: monospace; }

.badge-accion {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.badge-login   { background: #e6f4ea; }
.badge-logout  { background: #fff3cd; }
.badge-insert  { background: #e3f2fd; }
.badge-update  { background: #f3e5f5; }
.badge-delete  { background: #fce8e6; }
.badge-error   { background: #fce8e6; }

.det-json summary {
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--md-primario);
}
.det-json pre {
    margin-top: 6px;
    font-size: 0.72rem;
    background: var(--md-fondo);
    border-radius: 6px;
    padding: 8px;
    overflow-x: auto;
    max-width: 300px;
}
