/* Variables de color y diseño */
:root {
    --stp-primario: #2563eb;
    --stp-primario-hover: #1d4ed8;
    --stp-fondo: #f8fafc;
    --stp-borde: #e2e8f0;
    --stp-texto: #334155;
    --stp-texto-claro: #64748b;
    --stp-exito: #10b981;
    --stp-error: #ef4444;
}

/* Contenedor principal */
#stp-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--stp-texto);
    background: #ffffff;
    border: 1px solid var(--stp-borde);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    max-width: 1000px;
    margin: 0 auto;
}

.stp-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--stp-borde);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.stp-cabecera h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--stp-texto);
}

/* Botones */
.stp-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.stp-btn-primario {
    background: var(--stp-primario);
    color: white;
}

.stp-btn-primario:hover {
    background: var(--stp-primario-hover);
}

.stp-btn-secundario {
    background: var(--stp-borde);
    color: var(--stp-texto);
}

.stp-btn-secundario:hover {
    background: #cbd5e1;
}

/* Tabla de Tickets */
.stp-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.stp-tabla th, .stp-tabla td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--stp-borde);
}

.stp-tabla th {
    background: var(--stp-fondo);
    font-weight: 600;
    color: var(--stp-texto-claro);
}

/* Insignias de estado */
.stp-estado {
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.stp-estado-abierto { background: #dbeafe; color: #1e40af; }
.stp-estado-en-progreso { background: #fef3c7; color: #92400e; }
.stp-estado-resuelto { background: #d1fae5; color: #065f46; }

/* Formularios */
.stp-form-group {
    margin-bottom: 15px;
}

.stp-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.stp-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--stp-borde);
    border-radius: 6px;
    box-sizing: border-box;
}

/* Alertas */
.stp-alerta {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}
.stp-alerta-exito { background: #d1fae5; color: #065f46; border: 1px solid var(--stp-exito); }
.stp-alerta-error { background: #fee2e2; color: #991b1b; border: 1px solid var(--stp-error); }

.stp-acciones-cabecera { display: flex; gap: 10px; }
.stp-hilo-mensajes { display: flex; flex-direction: column; gap: 15px; margin: 20px 0; max-height: 400px; overflow-y: auto; padding-right: 10px; }
.stp-mensaje { background: var(--stp-fondo); padding: 15px; border-radius: 8px; border-left: 4px solid var(--stp-borde); }
.stp-mensaje-tecnico { border-left-color: var(--stp-primario); background: #eff6ff; }
.stp-mensaje-meta { font-size: 0.85rem; color: var(--stp-texto-claro); margin-bottom: 8px; font-weight: 600; }


/* Filtros de estado */
.stp-filtros {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stp-btn-filtro {
    background: var(--stp-fondo);
    border: 1px solid var(--stp-borde);
    color: var(--stp-texto-claro);
    padding: 6px 14px;
    border-radius: 20px; /* Estilo de píldora */
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.stp-btn-filtro:hover {
    background: #e2e8f0;
}

.stp-btn-filtro.activo {
    background: var(--stp-primario);
    color: white;
    border-color: var(--stp-primario);
}


/* Semáforos SLA */
.stp-semaforo { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.stp-semaforo-verde { background-color: #10b981; }
.stp-semaforo-amarillo { background-color: #f59e0b; }
.stp-semaforo-rojo { background-color: #ef4444; animation: parpadeo 1.5s infinite; }
.stp-semaforo-gris { background-color: #94a3b8; }

@keyframes parpadeo { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* Cajas de Información del Ticket */
.stp-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; background: #f8fafc; padding: 15px; border-radius: 6px; border: 1px solid var(--stp-borde); margin-bottom: 20px; }
.stp-info-item { font-size: 0.9rem; }
.stp-info-item strong { display: block; color: var(--stp-texto-claro); font-size: 0.8rem; text-transform: uppercase; margin-bottom: 3px; }

/* Cronómetro */
.stp-cronometro { font-family: monospace; font-size: 1.1rem; font-weight: bold; color: var(--stp-primario); background: #eff6ff; padding: 4px 8px; border-radius: 4px; border: 1px solid #bfdbfe; }

/* Tablas en Ajustes */
.stp-lista-catalogo { list-style: none; padding: 0; margin: 15px 0 0 0; border-top: 1px solid var(--stp-borde); }
.stp-lista-catalogo li { padding: 8px 0; border-bottom: 1px dashed var(--stp-borde); font-size: 0.9rem; }


/* Compactación de Interfaz General */
#stp-app { font-size: 0.85rem; max-width: 1200px; }
.stp-cabecera h2 { font-size: 1.25rem; }
.stp-tabla th, .stp-tabla td { padding: 8px 10px; font-size: 0.85rem; }
.stp-btn { padding: 5px 12px; font-size: 0.8rem; }
.stp-btn-filtro { font-size: 0.8rem; padding: 4px 12px; }
.stp-form-control { padding: 6px 8px; font-size: 0.85rem; }
.stp-info-item { font-size: 0.85rem; }
.stp-info-item strong { font-size: 0.75rem; }
.stp-cronometro { font-size: 0.95rem; padding: 2px 6px; }

/* Modificación de la lista de Ajustes para el botón Eliminar */
.stp-lista-catalogo li { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 6px 0; 
}


/* ==========================================
   COMPACTACIÓN MÁXIMA (DASHBOARD)
   ========================================== */
#stp-app { font-size: 0.8rem; max-width: 100%; }
.stp-cabecera { padding-bottom: 10px; margin-bottom: 15px; }
.stp-cabecera h2 { font-size: 1.1rem; }
.stp-tabla th, .stp-tabla td { padding: 4px 8px; font-size: 0.75rem; }
.stp-btn { padding: 4px 10px; font-size: 0.75rem; height: 26px; line-height: 1; }
.stp-btn-filtro { font-size: 0.75rem; padding: 2px 10px; }
.stp-form-control { padding: 4px 8px; font-size: 0.75rem; height: 26px; }
textarea.stp-form-control { height: auto; }
.stp-info-item { font-size: 0.75rem; }
.stp-info-item strong { font-size: 0.7rem; }
.stp-cronometro { font-size: 0.8rem; padding: 2px 4px; }
.stp-formulario h3 { font-size: 1rem; margin-bottom: 10px; }
.stp-form-group { margin-bottom: 10px; }
.stp-form-group label { font-size: 0.75rem; margin-bottom: 3px; }
.stp-filtros { margin-bottom: 0; }




/* ==========================================
   UI PULIDA Y MODERNA (ESTILO DASHBOARD)
   ========================================== */
:root {
    --stp-primario: #2563eb;
    --stp-primario-hover: #1d4ed8;
    --stp-fondo: #f8fafc;
    --stp-fondo-alt: #ffffff;
    --stp-borde: #e2e8f0;
    --stp-texto: #334155;
    --stp-texto-claro: #64748b;
    --stp-sombra: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

#stp-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--stp-texto);
    background: var(--stp-fondo-alt);
    border: 1px solid var(--stp-borde);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--stp-sombra);
    font-size: 0.85rem;
    max-width: 100%;
}

/* Cabecera y Navegación */
.stp-cabecera { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--stp-borde); padding-bottom: 15px; margin-bottom: 20px; }
.stp-cabecera h2 { font-size: 1.3rem; margin: 0; color: #0f172a; font-weight: 600; }
.stp-acciones-cabecera { display: flex; gap: 8px; flex-wrap: wrap; }

/* Botones con transiciones suaves */
.stp-btn {
    padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 0.8rem;
    transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center;
}
.stp-btn-primario { background: var(--stp-primario); color: white; box-shadow: 0 1px 2px rgba(37,99,235,0.3); }
.stp-btn-primario:hover { background: var(--stp-primario-hover); transform: translateY(-1px); }
.stp-btn-secundario { background: #f1f5f9; color: var(--stp-texto); border: 1px solid var(--stp-borde); }
.stp-btn-secundario:hover { background: #e2e8f0; }

/* Formularios y Cajas */
.stp-form-control { width: 100%; padding: 8px 10px; border: 1px solid var(--stp-borde); border-radius: 6px; font-size: 0.85rem; transition: border-color 0.2s; box-sizing: border-box; }
.stp-form-control:focus { outline: none; border-color: var(--stp-primario); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.stp-form-group { margin-bottom: 12px; }
.stp-form-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; color: #475569; }

/* Tablas pulidas */
.stp-tabla { width: 100%; border-collapse: collapse; margin-top: 10px; }
.stp-tabla th, .stp-tabla td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--stp-borde); font-size: 0.8rem; }
.stp-tabla th { background: var(--stp-fondo); font-weight: 600; color: var(--stp-texto-claro); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.stp-tabla tbody tr:hover { background-color: #f8fafc; }

/* Semáforos y Estados */
.stp-estado { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.stp-estado-abierto { background: #dbeafe; color: #1e40af; }
.stp-estado-en-progreso { background: #fef3c7; color: #92400e; }
.stp-estado-resuelto { background: #d1fae5; color: #065f46; }
.stp-estado-cerrado { background: #f1f5f9; color: #475569; }
.stp-semaforo { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 1px 2px rgba(0,0,0,0.2); }
.stp-semaforo-verde { background-color: #10b981; } .stp-semaforo-amarillo { background-color: #f59e0b; }
.stp-semaforo-rojo { background-color: #ef4444; animation: parpadeo 1.5s infinite; } .stp-semaforo-gris { background-color: #94a3b8; }
@keyframes parpadeo { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* Cuadrículas de Información */
.stp-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; background: var(--stp-fondo); padding: 15px; border-radius: 8px; border: 1px solid var(--stp-borde); margin-bottom: 20px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.stp-info-item { font-size: 0.85rem; } .stp-info-item strong { display: block; color: var(--stp-texto-claro); font-size: 0.75rem; text-transform: uppercase; margin-bottom: 4px; }
.stp-cronometro { font-family: monospace; font-size: 0.9rem; font-weight: bold; padding: 4px 8px; border-radius: 4px; display: inline-block; background: #eff6ff; color: var(--stp-primario); border: 1px solid #bfdbfe; }

/* Filtros rápidos */
.stp-filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.stp-btn-filtro { background: white; border: 1px solid var(--stp-borde); color: var(--stp-texto-claro); padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; font-weight: 500; }
.stp-btn-filtro.activo, .stp-btn-filtro:hover { background: var(--stp-primario); color: white; border-color: var(--stp-primario); box-shadow: 0 2px 4px rgba(37,99,235,0.2); }

/* Alertas */
.stp-alerta { padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; font-size: 0.85rem; display: flex; align-items: center; gap: 10px; animation: slideIn 0.3s ease; }
.stp-alerta-exito { background: #ecfdf5; color: #065f46; border: 1px solid #10b981; }
.stp-alerta-error { background: #fef2f2; color: #991b1b; border: 1px solid #ef4444; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================
   REGLAS DE IMPRESIÓN (PDF NATIVO)
   ========================================== */
@media print {
    body * { visibility: hidden; } /* Oculta toda la página web (header, footer de WP) */
    #stp-area-impresion, #stp-area-impresion * { visibility: visible; } /* Muestra solo el reporte */
    #stp-area-impresion { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; background: white; border: none; box-shadow: none; }
    .stp-no-print { display: none !important; } /* Ocultar botones en el PDF */
    .stp-tabla th { background-color: #f1f5f9 !important; -webkit-print-color-adjust: exact; color: #000; }
    .stp-tabla th, .stp-tabla td { border: 1px solid #cbd5e1; }
}



/* Mejoras de usabilidad en formularios */
.stp-form-control { 
    width: 100%; 
    padding: 8px 12px; 
    border: 1px solid var(--stp-borde); 
    border-radius: 6px; 
    font-size: 0.85rem; /* Fuente ligeramente más grande para lectura */
    transition: border-color 0.2s; 
    box-sizing: border-box; 
    height: 38px; /* Altura estándar para que quepa bien el texto */
    background-color: #fff;
    color: #334155;
}

/* Ajuste específico para los selects (dropdowns) */
select.stp-form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: 98%;
    background-position-y: 50%;
    padding-right: 30px; /* Espacio para la flechita */
    text-overflow: ellipsis; /* Pone '...' si el texto es inmenso */
    white-space: nowrap;
    overflow: hidden;
}

select.stp-form-control:focus, input.stp-form-control:focus, textarea.stp-form-control:focus { 
    outline: none; 
    border-color: var(--stp-primario); 
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1); 
}

textarea.stp-form-control { 
    height: auto; 
    min-height: 100px;
    resize: vertical; /* Permite al usuario hacer más grande la caja si necesita escribir mucho */
}














