/* ==========================================================================
   1. VARIABLES Y RESET
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Elms+Sans:ital,wght@0,100..900;1,100..900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #01a79d;        
    --primary-dark: #087770;
    --secondary: #3c454e;      
    --accent: #3498db;
    --bg-body: #eef2f6;        
    --bg-card: #ffffff;
    --text-main: #2d3748;      
    --text-muted: #718096;
    --border-color: #cccccc;
    --success: #27ae60;        
    --success-light: #42d392;
    --danger: #e74c3c;         
    --warning: #f1c40f;
    --info: #3498db;           
    --comment-light: #aaa9a9;
    --font-main: "Elms Sans", sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 8px;             
    --radius-pill: 50px;
}

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

body {
    font-family: var(--font-main); 
    font-weight: 300;
    background-color: var(--bg-body);
    background-image: radial-gradient(var(--primary) 0.5px, transparent 0.5px), radial-gradient(var(--primary) 0.5px, #f0f2f5 0.5px);
    background-size: 20px 20px; 
    background-position: 0 0, 10px 10px;
    color: var(--text-main);
    padding-top: 80px; 
    padding-bottom: 40px; 
    font-size: 15px; 
    width: 100%; 
    min-height: 100vh;
}

a { text-decoration: none; transition: all 0.3s ease; }
.hr-divisor { border: 0; height: 1px; background: #eaedf1; margin: 15px 0; width: 100%; }

/* ==========================================================================
   2. UTILIDADES GENERALES (Espaciados, Alineaciones, Textos unificados)
   ========================================================================== */
/* Alineaciones */
.center, .text-center, .centrado, .align-centro { text-align: center !important; }
.alineado-dcha, .text-right { text-align: right !important; padding-right: 15px !important; }
.ancho-completo, .w-100 { width: 100%; }
.ancho-completo { grid-column: 1 / -1; }
.no-wrap, .celda-nowrap, .una-linea { white-space: nowrap; }

/* Márgenes */
.mb-15 { margin-bottom: 15px; } .mb-20 { margin-bottom: 20px; } .mb-25 { margin-bottom: 25px; }
.mt-10 { margin-top: 10px; } .mt-15 { margin-top: 15px; } .mt-20 { margin-top: 20px; } .mt-25 { margin-top: 25px; }
.align-right-mb20 { text-align: right; margin-bottom: 20px; }
.mt-auto-pt20 { margin-top: auto; padding-top: 20px; } 
.icon-margin { margin-right: 8px; }
.gap-10 { gap: 10px; }

/* Colores de texto e iconos unificados */
.text-blue, .texto-azul, .icono-azul { color: #3498db; }
.texto-azul { font-weight: bold; }
.text-green, .texto-verde, .color-exito, .icono-verde, .txt-origen-presup { color: #27ae60; }
.texto-verde { font-weight: bold; font-size: 12px; }
.text-red, .texto-rojo, .color-error, .icon-danger, .icon-pdf { color: #e74c3c; }
.texto-rojo { font-weight: bold; }
.texto-naranja, .icono-naranja { color: #f39c12; }
.texto-naranja { font-weight: bold; }
.color-primario { color: var(--primary); font-weight: 500; }
.txt-gris, .texto-gris { color: #7f8c8d; font-size: 0.9em; font-weight: 500; padding-left: 5px; }
.txt-secundario { font-size: 0.85em; color: #555; }
.txt-pequeno { font-size: 0.85em; }

/* Misc */
.form-contents { display: contents; }
.img-opaca { opacity: 0.3; cursor: default; }
.alerta-vacio { text-align: center; padding: 30px; }
.alerta-vacio p { font-size: 1.2em; color: #e74c3c; margin-bottom: 15px; }
.icon-lg { font-size: 25px; transition: color 0.2s; }
.icon-repeticion { color: #8e44ad; }
.icon-shipping { color: #e67e22; }
.icon-pdf:hover { color: #c0392b; }
.icon-repeat { color: #3498db; }
.icon-repeat:hover { color: #2980b9; }

/* ==========================================================================
   3. LOGIN Y MANTENIMIENTO (Bloque Restaurado)
   ========================================================================== */
.login-body {
    background-color: var(--bg-body); height: 100vh; display: flex; align-items: center; justify-content: center;
    background-image: radial-gradient(var(--primary) 0.5px, transparent 0.5px), radial-gradient(var(--primary) 0.5px, #f0f2f5 0.5px);
    background-size: 20px 20px; background-position: 0 0, 10px 10px;
    margin: 0; font-family: var(--font-main);
    padding: 0 !important; /* Evita que el padding del body global rompa el login */
}
.login-container { width: 100%; max-width: 900px; padding: 20px; animation: fadeIn 0.8s ease-out; }
.login-card { display: flex; background: #ffffff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1); overflow: hidden; min-height: 550px; }
.login-visual { flex: 1; position: relative;  }
.bg-image { width: 100%; height: 100%; object-fit: cover; opacity: 1.0; mix-blend-mode: multiply; }
.version { font-size: 0.75rem; color: #ccc; font-weight: 500; }
.visual-overlay { position: absolute; bottom: 40px; left: 40px; right: 40px; color: white; z-index: 2; }
.visual-overlay h3 { color: #fff; font-size: 1.8rem; margin-bottom: 10px; font-weight: 700; background-color: transparent !important; }
.visual-overlay p { font-size: 1rem; opacity: 0.9; font-weight: 300; }

.login-form-wrapper { flex: 1; padding: 50px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.login-header { margin-bottom: 30px; text-align: center; }
.login-header h4 { font-size: 1.8rem; color: var(--secondary); margin-bottom: 5px; font-weight: 700; }
.subtexto { color: var(--text-muted); font-size: 0.9rem; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--secondary); margin-bottom: 8px; text-align: left; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 15px; color: #a0aec0; transition: color 0.3s; }
.campo-moderno { width: 100%; padding: 12px 15px 12px 45px !important; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 1rem; transition: all 0.3s ease; background: #f8fafc; }
.campo-moderno:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(1, 167, 157, 0.1); outline: none; }
.campo-moderno:focus + .input-icon, .input-wrapper:focus-within .input-icon { color: var(--primary); }
.btn-login-modern { width: 100%; padding: 14px; background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(1, 167, 157, 0.3); display: flex; justify-content: center; align-items: center; gap: 10px; }
.btn-login-modern:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(1, 167, 157, 0.4); }
.btn-login-modern:active { transform: translateY(0); }
.login-footer { margin-top: 20px; text-align: center; font-size: 0.9rem; color: var(--text-muted); }
.link-contacto { color: var(--primary); font-weight: 600; text-decoration: none; }
.brand-footer { margin-top: 40px; display: flex; align-items: center; justify-content: center; gap: 10px; border-top: 1px solid #eee; padding-top: 20px; }
.mini-logo { height: 24px; opacity: 0.7; transition: opacity 0.3s; }
.mini-logo:hover { opacity: 1; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.body-maintenance { height: 100vh; display: flex; justify-content: center; align-items: center; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; margin: 0; padding: 0 !important; }
.maintenance-container { width: 100%; max-width: 700px; padding: 20px; }
.maintenance-content { background: var(--primary-dark); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 50px 30px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); }
.maintenance-icon-box { font-size: 4rem; color: #fff; margin-bottom: 20px; }
.maintenance-content h1 { font-size: 2.5rem; margin-bottom: 15px; color: #fff; }
.btn-maintenance { display: inline-block; padding: 12px 30px; background-color: #333; color: white; border-radius: 50px; font-weight: 600; text-decoration: none; margin-top: 30px; transition: background 0.3s; }
.btn-maintenance:hover { background-color: #000; color: #fff; }
.input-icon-right { position: absolute; right: 15px; color: #a0aec0; cursor: pointer; transition: color 0.3s; }
.input-icon-right:hover { color: var(--primary); }
/* Ajustamos el campo moderno para que el texto no pise el icono del ojo */
.campo-moderno.con-ojo { padding-right: 45px !important; }

/* Cotizador y módulos de 3 columnas */
.layout-tres-columnas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Modificadores de la tarjeta de resultado */
.stat-card-res { padding: 25px 20px; }
.res-title { color: #172983; margin-top: 0; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.res-detail { font-size: 0.9em; margin-bottom: 20px; line-height: 1.4; color: #555; }
.res-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 0.95em; }
.res-table td { padding: 8px 0; border-bottom: 1px dashed #eee; }
.res-table .td-calc { color: #777; font-size: 0.85em; }
.res-table .td-bold { font-weight: bold; color: #333; }
.res-table .tr-total td { border-bottom: none; border-top: 2px solid #333; padding-top: 15px; font-size: 1.1em; }
.unit-cost-box { background: #f8f9fa; border: 1px solid #ddd; padding: 15px; text-align: center; border-radius: 4px; margin-bottom: 20px; }
.unit-cost-val { font-size: 1.8em; color: #27ae60; }
.info-legal-presupuesto { font-size: 0.75em; color: #888; text-align: justify; line-height: 1.4; margin-top: 25px; padding-top: 15px; border-top: 1px solid #eee; }
.info-legal-titulo { color: #666; margin-bottom: 5px; font-weight: bold; }

/* Caja de Consultas Especiales */
.caja-consultar {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.caja-consultar h4 { color: #e74c3c; margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.grupo-cons { margin-bottom: 20px; }
.grupo-cons label { display: block; font-weight: bold; color: #444; margin-bottom: 5px; }
.grupo-cons input[type="number"], .grupo-cons input[type="text"], .grupo-cons textarea {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box;
}
.btn-enviar-cons {
    background-color: #27ae60; color: white; border: none; padding: 12px 20px; border-radius: 4px; font-weight: bold;
    cursor: pointer; width: 100%; transition: background 0.3s;
}
.btn-enviar-cons:hover { background-color: #219653; }

/* --- COTIZADOR: Lista de manipulados punteada --- */
#contenedor_manipulados {
    display: flex; flex-direction: column;}
#contenedor_manipulados label {
    display: flex; align-items: center; padding: 10px 0; border-bottom: 1px dotted #ccc; margin: 0; width: 100%; cursor: pointer; }
#contenedor_manipulados label:last-child {
    border-bottom: none; }
#contenedor_manipulados input[type="checkbox"] {
    margin-right: 10px; width: 18px; height: 18px; }

/* --- COTIZADOR: Fila horizontal de 4 botones --- */
.fila-botones-resultado {
    display: flex; gap: 8px; margin-bottom: 15px; width: 100%; }
.fila-botones-resultado button {
    flex: 1; padding: 10px 5px; font-size: 0.75em; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.2; border-radius: 6px; margin: 0 !important; }
.fila-botones-resultado button i {
    font-size: 1.6em; margin-bottom: 6px;}

/* ==========================================================================
   4. LAYOUT GENERAL (Estructura, Grids y Módulos)
   ========================================================================== */
.cuerpo { width: 100%; min-height: 70vh; overflow-y: auto; }
.contenido { width: 99%; margin: 0 auto; padding: 0 10px; max-width: 2100px; display: block; clear: both; }

h3 {
    font-size: 1.5rem; color: var(--primary-dark); margin-bottom: 25px; font-weight: 300;
    border-bottom: 2px solid var(--border-color); padding: 12px;
    display: flex; justify-content: space-between; align-items: center;
    background-color: #fff; border-radius: var(--radius);
}
h3 span { font-size: 1.2rem; color: var(--text-main); }

/* Sistema Legacy y Layouts */
.bloque1 { float: left; width: 24%; margin-right: 1%; }
.bloque2 { float: left; width: 75%; }
.bloque-full { width: 100%; float: none; clear: both; }

.modulo1, .modulo2, .chart-box, .panel-blanco {
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
    padding: 20px; margin-bottom: 10px; border-left: 4px solid var(--primary);
}
.cabecera-modulo { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; }
.cabecera-modulo h5 { margin: 0; font-weight: 400; font-size: 1.4em; color: #333; }
.cabecera-modulo.bg-naranja { background-color: #f39c12; color: #fff; padding: 10px; border-radius: 4px; }
.cabecera-modulo.bg-dark { background-color: #34495e; color: #fff; padding: 10px; border-radius: 4px; }
.margen { padding: 5px 0; }

/* Sistemas de Grids y Flexbox */
.grid-3-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 15px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; }
.grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-4-columnas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 15px; }
.layout-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; align-items: stretch; }
.layout-col-third { flex: 1 1 calc(33.333% - 14px); min-width: 320px; display: flex; flex-direction: column; }
.col-modulo { height: 100%; margin: 0 !important; display: flex; flex-direction: column; width: 100%; float: none !important; }
.col-modulo .margen { flex: 1; display: flex; flex-direction: column; }
.flex-gap-10 { display: flex; gap: 10px; }
.flex-gap-15 { display: flex; gap: 15px; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.flex-center { display: flex; align-items: center; }

/* Layout Expediente Unificado */
.layout-expediente, .layout-proforma { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; width: 100%; }
.col-izq, .proforma-sidebar { display: flex; flex-direction: column; gap: 20px; align-self: start; }

/* ==========================================================================
   5. NAVEGACIÓN SUPERIOR Y FOOTER
   ========================================================================== */
.navbar-top {
    position: fixed; top: 0; left: 0; width: 100%; height: 70px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex; align-items: center; padding: 0 20px;
    box-shadow: 0 4px 15px rgba(0, 168, 150, 0.25); z-index: 1000;
}
.nav-logo img { height: 45px; filter: brightness(0) invert(1); }
.nav-menu { flex-grow: 1; display: flex; justify-content: flex-end; margin-right: 20px; }
.nav-list { display: flex; gap: 5px; align-items: center; list-style: none; }
.nav-item { position: relative; height: 70px; display: flex; align-items: center; }
.nav-link { color: #fff; text-decoration: none; font-size: 0.95rem; padding: 8px 16px; border-radius: var(--radius-pill); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav-link:hover { background-color: rgba(255, 255, 255, 0.15); }

.dropdown-menu { display: none; position: absolute; top: 60px; right: 0; background-color: #fff; min-width: 220px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 10px 0; z-index: 1001; }
.nav-item:hover .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; padding: 10px 20px; color: var(--text-main); font-size: 0.9rem; }
.dropdown-item:hover { background-color: #f0f7f6; color: var(--primary-dark); }
.dropdown-item i { width: 25px; color: var(--primary); text-align: center; }

.user-actions { display: flex; align-items: center; gap: 15px; }
.user-capsule { background: rgba(0,0,0,0.15); padding: 5px 15px; border-radius: var(--radius-pill); display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; border: 1px solid rgba(255,255,255,0.1); }
.u-name { color: #fff; font-weight: 600; font-size: 0.85rem; }
.u-role { color: rgba(255,255,255,0.8); font-size: 0.7rem; text-transform: uppercase; }
.btn-logout { color: white; opacity: 0.8; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; }
.mobile-toggle, .btn-logout-mobile, .mobile-user-info, .mobile-divider { display: none; }

.footer { height: 25px; background: #000; color: #eee; position: fixed; bottom: 0; left: 0; width: 100%; padding: 0 20px; margin: 0; z-index: 9999; display: flex; justify-content: space-between; align-items: center; }
.footer P { margin: 0; padding: 0; color: #fff; font-size: 12px; }
.footer P A { color: #fff; }

/* ==========================================================================
   6. TABLAS, LISTADOS Y BUSCADOR
   ========================================================================== */
table.listado { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 20px; font-size: 0.9em; }
.listado th { background-color: var(--secondary); color: #ffffff; padding: 12px 15px; border-bottom: 2px solid var(--primary-dark); text-transform: uppercase; font-size: 0.8rem; text-align: left; }
.listado td { padding: 10px 15px; border-bottom: 1px solid #eee; color: var(--text-main); vertical-align: middle; }
.listado tr:nth-child(even) { background-color: #f9f9f9; }
.listado tr:hover, .fila-seleccionable:hover { background-color: #edf2f7; cursor: pointer; }
.fila-seleccionable { transition: background-color 0.2s; }
.fila-seleccionada { background-color: #d6eaf8 !important; }
/* Forzamos el alineado a la derecha en cabecera y celda de acciones */
table.listado thead tr th.celda-acciones,
table.listado tbody tr td.celda-acciones {
    text-align: right !important; width: 80px; padding-right: 20px !important; }
	
/* 2. Estilo del botón contenedor: Eliminamos bordes, fondos y forzamos el cursor */
.btn-borrar-icono {
    background: none !important; border: none !important; padding: 0 !important; margin: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: flex-end; outline: none !important; }

/* 3. Estilo del icono: Color rojo corporativo y aumento de tamaño */
.icon-borrar {
	color: #e53e3e; font-size: 1.4rem; transition: color 0.15s, transform 0.15s; display: block; }

/* 4. Efecto Hover: Cambiamos color y un ligero zoom para feedback visual */
.icon-borrar:hover {
    color: #c53030; transform: scale(1.1); }

/* Buscador Unificado */
.buscadorprincipal { width: 33.33%; min-width: 320px; margin-bottom: 20px; margin-left: auto;}
.form-buscador-flex, form.buscador { display: flex; width: 33.33%; min-width: 450px; gap: 10px; align-items: center; justify-content: flex-end; }

/* Ajuste para el contenedor del buscador con select e input */
.form-buscador-flex {
    display: flex; align-items: center; gap: 10px; width: 100%;}
	
.form-buscador-flex select, .form-buscador-flex input { height: 38px; margin-bottom: 0 !important; box-sizing: border-box; }
.form-buscador-flex select { flex: 1; max-width: 180px; }
.form-buscador-flex input {
    flex: 2; }

	
.form-buscador-flex .select2-container, form.buscador select { flex-grow: 1; width: 50% !important; min-width: 120px; box-shadow: var(--shadow-sm); }
.form-buscador-flex input, form.buscador input { margin-bottom: 0 !important; }
.input-texto-libre, form.buscador input { flex-grow: 1; padding: 10px; border: 1px solid #ccc; border-radius: 4px; width: 50%; box-shadow: var(--shadow-sm); box-sizing: border-box; }
.buscar, button.buscar { width: 42px; height: 36px; background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.buscar:hover, button.buscar:hover { background: var(--primary-dark); }
.form-buscador-flex button.buscar { height: 38px; display: flex; align-items: center; justify-content: center; margin-bottom: 0 !important; }
.res-busqueda-empty { padding: 20px; text-align: center; color: #555; }
.res-busqueda-icon { margin-bottom: 10px; color: #e74c3c; }

/* Paginación */
ul.paginacion { display: flex; justify-content: center; gap: 5px; margin-top: 30px; list-style-type: none; }
ul.paginacion li a { display: block; padding: 8px 14px; background: #fff; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-main); }
ul.paginacion li.active a { background-color: var(--primary); color: #fff; border-color: var(--primary); }

/* Checkboxes y Listas de Datos */
.lista-datos { list-style: none; padding: 0; margin: 0; }
.lista-datos li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #f0f0f0; }
.lista-datos li:last-child { border-bottom: none; }
.etiqueta { font-weight: 600; color: #555; font-size: 0.9em; }
.valor { text-align: right; color: #333; font-weight: 500; font-size: 0.9em; max-width: 65%; word-break: break-word; }

/* Resumen de canales de notificación */
.canales-wrapper { display: flex; justify-content: flex-end; align-items: center; gap: 15px; white-space: nowrap; }
.canal-notif { display: inline-flex; align-items: center; gap: 5px; margin: 0 !important; font-size: 0.9em; }
.notif-on { color: var(--success); font-weight: bold; }
.notif-off { color: #ccc; }
.id-telegram-resumen { font-size: 0.85em; color: var(--text-muted); font-style: italic; display: block; margin-top: 5px; }

/* Checkboxes adaptados a móvil */
.grupo-checkboxes { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 5px; margin-bottom: 15px; }
.checkbox-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.95rem; color: #444; }
.checkbox-wrapper input[type="checkbox"] { width: 18px; height: 18px; margin: 0; cursor: pointer; }

/* --- VISTA ARTÍCULOS: Cabecera y Buscador --- */
.buscador-ampliado { 
	width: 100%; max-width: 900px; margin-left: auto; margin-bottom: 15px; }
.contenedor-acciones-listado {
    display: flex; justify-content: flex-start; align-items: center; gap: 15px; margin-bottom: 15px; }

/* --- VISTA ARTÍCULOS: Control de anchos de tabla --- */
table.listado th.col-check, table.listado td.col-check { width: 40px; text-align: center; }
table.listado th.col-id, table.listado td.col-id { width: 60px; text-align: center; }
table.listado th.col-familia { width: 15%; }
table.listado th.col-tecnicas { width: 20%; }
table.listado th.col-manipulados { width: 15%; }
table.listado th.col-estado, table.listado td.col-estado { width: 10%; text-align: center; }

/* ==========================================================================
   7. FORMULARIOS, SELECTS Y SWEETALERT
   ========================================================================== */
.formulario-moderno { width: 100%; }
.grid-form-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 0px 20px; width: 100%; margin-bottom: 30px; }
.form-cabecera-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 15px; }
.form-fila-mitad, .grupo-doble-input { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; width: 100%; }

.grupo { display: flex; flex-direction: column;}
.grupo label, .form-label-bold { font-weight: 600; font-size: 0.9rem; color: #555; padding-bottom: 3px; display: block; }

.obligatorio { color: #e74c3c; font-weight: bold; margin-left: 2px; }

.campoform, input[type="text"], input[type="email"], input[type="date"], input[type="number"], select, textarea, .form-control {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border-color);
    border-radius: 6px; background-color: #fff; font-family: var(--font-main);
    box-sizing: border-box; margin-bottom: 10px;}

.enlace-orden, .listado th a { 
    color: #ffffff !important; text-decoration: none; display: flex; align-items: center; gap: 5px; }
.enlace-orden:hover, .listado th a:hover { 
    color: #d1d5db !important; }

.campoform:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.1); }
.campoform:disabled { background-color: #f9f9f9; color: #999; cursor: not-allowed; }
textarea.campoform { resize: vertical; }

.input-no-spinner::-webkit-outer-spin-button, .input-no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-no-spinner[type=number] { -moz-appearance: textfield; }
.check-gigante { width: 22px; height: 22px; cursor: pointer; }
.checkbox-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; background: #fdfdfd; border: 1px solid #eee; padding: 8px; border-radius: 4px; transition: background 0.2s; height: 38px; }
.checkbox-wrapper:hover { background: #f5f5f5; }

/* SweetAlert Avanzado Unificado */
.swal-custom-container { text-align: left; font-size: 0.9em; }
.swal-text-left { text-align: left; }
.swal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.swal-form-label, .swal-custom-label { display: block; text-align: left; font-size: 13px; font-weight: bold; color: #555; margin-top: 10px; margin-bottom: 5px; }
.swal2-input-full { width: 100%; margin: 0; box-sizing: border-box; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.swal2-input-full:focus { border-color: #3498db; outline: none; }
.swal-caja-huecos { background: #f9f9f9; padding: 15px; border-radius: 5px; border: 1px solid #eee; margin-top: 15px; }
.swal-txt-info { color: #777; display: block; margin-top: 5px; font-size: 0.85em; }

/* --- FORMULARIOS: Cuadrícula de 4 columnas para listados --- */
.grid-4-columnas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 10px;
}
.columna-man h6 {
    color: var(--primary); /* Azul corporativo */
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    font-size: 0.95rem;
}
.lista-checks-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.precio-man {
    color: var(--success); /* Verde corporativo */
    font-weight: bold;
    font-size: 0.85em;
}
.txt-vacio {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85em;
}

/* --- LISTADO PEDIDOS: Estados de mercancía --- */
.badge-parcial {
    background-color: #f39c12; /* Naranja/Amarillo */
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    display: inline-block;
    margin-top: 4px;
}

.badge-completo {
    background-color: #27ae60; /* Verde */
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    display: inline-block;
    margin-top: 4px;
}

.icon-shipping-empty {
    color: #cccccc;
    font-size: 1.5em;
}

/* --- LISTADO PEDIDOS: Ajustes visuales --- */
.img-pedido-80 {
    width: 40px;
    height: 40px;
    object-fit: cover; /* Para que la imagen no se deforme aunque sea rectangular */
    border-radius: 4px;
    cursor: zoom-in;
}

.txt-cliente-primario {
    color: var(--primary, #172983); /* Color corporativo principal */
    font-weight: bold;
}

/* --- VISTA PEDIDOS TERMINADOS --- */
.icon-purple { 
    color: #8e44ad; 
}
.icon-purple:hover {
    color: #9b59b6;
}

/* ==========================================================================
   VISTA: PANEL DE ASIGNACIÓN (KANBAN PRODUCCIÓN)
   ========================================================================== */

/* Cabeceras y Grids */
.cabecera-panel { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cabecera-panel .titulo-panel { margin-bottom: 0; }
.grid-asignacion { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }
.maquina-card { background: #fff; border: 1px solid #ddd; border-radius: 5px; padding: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow-x: auto; }
.maquina-card-inferior { margin-bottom: 30px; }
.maquina-card-tecnica { margin-bottom: 20px; }
.fila-placeholder { background-color: #fcf8e3; border: 1px dashed #faebcc; height: 50px; }
.bloque-inferior-kanban { margin-top: 40px; }

/* Buscador Modal Kanban */
.buscador-moderno-container { display: flex; align-items: stretch; width: 450px; }
.input-buscador-moderno { flex: 1; padding: 10px 15px; border: 1px solid #ced4da; border-right: none; border-radius: 4px 0 0 4px; font-size: 13px; outline: none; color: #555; transition: border-color 0.2s; }
.input-buscador-moderno:focus { border-color: #52b3a9; }
.input-buscador-moderno::placeholder { color: #999; }
.btn-buscador-moderno { background-color: #52b3a9; color: white; border: 1px solid #52b3a9; border-radius: 0 4px 4px 0; padding: 0 16px; cursor: pointer; font-size: 15px; transition: background 0.2s; }
.btn-buscador-moderno:hover { background-color: #3e988f; }

/* Tabla Asignar */
.asignar { width: 100%; border-collapse: collapse !important; border-spacing: 0 !important; font-size: 0.80rem; }
.asignar th, .asignar td { padding: 8px 5px !important; border: none !important; border-bottom: 3px solid #ecf0f1 !important; vertical-align: middle; }
.asignar th { color: #ffffff; background-color: #34495e; font-size: 0.75rem; text-transform: uppercase; font-weight: bold; }
.asignar caption { padding: 12px 15px; font-size: 1.05rem; font-weight: bold; text-transform: uppercase; border-radius: 4px 4px 0 0; text-align: left; background-color: #95a5a6; color: #fff; }
.asignar caption a { color: #fff; text-decoration: none; }
.asignar caption .contador { font-size: 0.8em; opacity: 0.8; font-weight: normal; margin-left: 10px; }

/* Tipografías y celdas */
.cliente-negrita { font-weight: 700; font-size: 0.85rem; color: #111; }
.asignar td.orden { background-color: #e2e6e9 !important; text-align: center !important; }
.num-orden { font-size: 1.2rem; font-weight: 900; color: #2c3e50; }
.celda-interactiva { width: 20px; cursor: pointer; transition: background-color 0.2s; border-right: 1px solid #ddd; }

/* Colores de estado e iconos */
.bg-rojo { background-color: #e74c3c !important; color: white !important; }
.bg-morado { background-color: #9b59b6 !important; color: white !important; }
.bg-verde { background-color: #2ecc71 !important; color: white !important; }
.bg-naranja { background-color: #f39c12 !important; color: white !important; }
.bg-info { background-color: #3498db !important; color: white !important; }
.bg-gris { background-color: #f1f1f1 !important; }

/* Colores Máquinas */
.azul { background-color: #3498db !important; }
.naranja { background-color: #e67e22 !important; }
.morado { background-color: #9b59b6 !important; }
.negro { background-color: #34495e !important; }
.amarillo { background-color: #f1c40f !important; color: #333 !important; }
.amarillo a { color: #333 !important; }

/* Iconos de Play/Pause/Stop */
.icon-play, .icon-stop, .icon-pause { font-size: 1.8rem; transition: transform 0.2s ease; cursor: pointer; }
.icon-play { color: #27ae60; }
.icon-stop { color: #e74c3c; }
.icon-pause { color: #f39c12; }
.icon-play:hover, .icon-stop:hover, .icon-pause:hover { transform: scale(1.15); }
.icon-no-mercancia { font-size: 1.5rem; color: #e74c3c; }

/* Botones de acción */
.btn-accion-kanban { border: none; border-radius: 4px; padding: 6px 12px; cursor: pointer; transition: transform 0.1s, opacity 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.btn-accion-kanban:hover { opacity: 0.9; transform: scale(1.05); }
.btn-verde-btn { background-color: #27ae60 !important; color: white !important; }
.btn-rojo-btn { background-color: #e74c3c !important; color: white !important; }

/* Modales Asignación / Finalización */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-caja { background: #fff; width: 400px; border-radius: 6px; overflow: hidden; }
.modal-cabecera { background: #333; color: #fff; padding: 15px; display: flex; justify-content: space-between; align-items: center; }
.btn-cerrar { background: transparent; border: none; color: #fff; font-size: 24px; cursor: pointer; }
.modal-cuerpo { padding: 20px; }
.input-select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; margin-top: 10px; }
.modal-pie { padding: 15px 20px; background: #f9f9f9; text-align: right; border-top: 1px solid #eee; }
.btn-guardar-rojo { background: #e74c3c; color: #fff; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* SWAL Formularios (Fin producción y mercancía) */
.swal-form-label { display: block; text-align: left; font-size: 13px; font-weight: bold; color: #555; margin-top: 10px; margin-bottom: 5px; }
.swal2-input-full { width: 100%; margin: 0; box-sizing: border-box; }
.swal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.swal-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.swal-titulo-seccion { font-size: 14px; font-weight: bold; color: #333; margin-top: 15px; display: block; border-bottom: 1px solid #eee; padding-bottom: 5px; text-align: left;}

.input-stepper { display: flex; align-items: center; border-radius: 4px; overflow: hidden; border: 1px solid #ccc; }
.input-stepper button { width: 45px; height: 38px; background: #f9f9f9; border: none; font-weight: bold; font-size: 18px; cursor: pointer; color: #555; transition: background 0.2s; }
.input-stepper button:hover { background: #e0e0e0; }
.input-stepper input { flex: 1; height: 38px; text-align: center; border: none; border-left: 1px solid #ccc; border-right: 1px solid #ccc; box-sizing: border-box; margin: 0; font-size: 15px; }
.input-stepper input:focus { outline: none; }

.radio-btn-group { display: flex; gap: 10px; }
.radio-btn-group input[type="radio"] { display: none; }
.radio-btn-group label { flex: 1; text-align: center; padding: 10px; border: 1px solid #ccc; border-radius: 8px; cursor: pointer; background: #f9f9f9; color: #7f8c8d; font-weight: bold; transition: all 0.2s; font-size: 14px; margin: 0; }
.radio-btn-group input[type="radio"]#pre-no:checked + label { background: #95a5a6; color: white; border-color: #7f8c8d; }
.radio-btn-group input[type="radio"]#pre-si:checked + label { background: #fff4e5; color: #d35400; border-color: #e67e22; }

.contenedor-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; margin-top: 10px; }
.pill-empleado { padding: 6px 12px; border: 1px solid #ddd; border-radius: 20px; background: #f9f9f9; cursor: pointer; font-size: 12px; transition: all 0.2s; }
.pill-empleado.selected { background: #3498db; color: white; border-color: #2980b9; }

/* Utilidades Extra */
.border-verde { border-color: #27ae60 !important; }
.txt-center { text-align: center; }
.fw-bold { font-weight: bold; }
.text-rojo { color: #e74c3c; }
.text-naranja { color: #f39c12; }
.text-info-color { color: #3498db; }
.text-verde { color: #27ae60; }

/* Utilidad global para ocultar elementos de inicio (modales, loaders, etc.) */
.d-none {
    display: none;
}

/* Y ya que estamos, el diseño del loader de IA para que se vea bien centrado cuando se active */
.cargando-ia {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: var(--primary, #172983);
}
.cargando-ia i {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Barra inferior de la IA */
.barra-preview-ia {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #34495e;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9998;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
.btn-preview-ko { background: #e74c3c; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; margin-right: 10px; font-weight: bold; }
.btn-preview-ok { background: #27ae60; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* --- KANBAN ASIGNACIÓN: Forzar 2 columnas --- */
.grid-asignacion {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px;
    align-items: start;
}

/* --- KANBAN ASIGNACIÓN: Miniaturas reducidas --- */
.img-miniatura {
    width: 45px !important;
    height: 45px !important;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: zoom-in;
}

/* --- KANBAN ASIGNACIÓN: Colores de las cabeceras --- */
table.asignar caption.rojo { background-color: #e74c3c !important; color: white !important; }
table.asignar caption.azul { background-color: #3498db !important; color: white !important; }
table.asignar caption.verde { background-color: #2ecc71 !important; color: white !important; }
table.asignar caption.naranja { background-color: #e67e22 !important; color: white !important; }
table.asignar caption.morado { background-color: #9b59b6 !important; color: white !important; }
table.asignar caption.negro { background-color: #34495e !important; color: white !important; }
table.asignar caption.amarillo { background-color: #f1c40f !important; color: #333 !important; }

/* --- KANBAN ASIGNACIÓN: Cursor de arrastre (Drag & Drop) --- */
.sortable-list tr {
    cursor: grab !important;
}

/* Cambia a la mano cerrada mientras mantienes el clic apretado */
.sortable-list tr:active {
    cursor: grabbing !important;
}

/* --- KANBAN ASIGNACIÓN: Panel de Pedidos Sin Asignar --- */
.caption-flex { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
}
.btn-ia { 
    background: linear-gradient(135deg, #8e44ad, #3498db); 
    color: white; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 4px; 
    font-weight: bold; 
    cursor: pointer; 
    font-size: 0.8rem; 
    transition: transform 0.2s; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
}
.btn-ia:hover { 
    transform: scale(1.05); 
}
.td-selector-manual {
    background-color: #f2f3f4; 
    text-align: center; 
    padding: 5px !important; 
}
.select-manual-asignar {
    width: 100%; 
    padding: 5px; 
    border: 1px solid #7f8c8d; 
    border-radius: 4px; 
    background-color: white; 
    font-weight: bold;
}
.fila-asignada-ia {
    background-color: #e8f8f5 !important;
}

/* --- KANBAN ASIGNACIÓN: Selectores Manuales (Colores) --- */
.td-selector-manual-azul {
    background-color: #d6eaf8; 
    text-align: center; 
    padding: 5px !important; 
}
.select-manual-asignar-azul {
    width: 100%; 
    padding: 5px; 
    border: 1px solid #2980b9; 
    border-radius: 4px; 
    background-color: white; 
    font-weight: bold;
}

/* --- KANBAN ASIGNACIÓN: Selectores Manuales Tampografía (Naranjas) --- */
.td-selector-manual-naranja {
    background-color: #ffe0b2; 
    text-align: center; 
    padding: 5px !important; 
}
.select-manual-asignar-naranja {
    width: 100%; 
    padding: 5px; 
    border: 1px solid #e67e22; 
    border-radius: 4px; 
    background-color: white; 
    font-weight: bold;
}

/* --- VISTA PEDIDOS AL LÍMITE DE PLAZO --- */
.txt-fecha-limite-roja {
    white-space: nowrap;
    color: #c0392b;
    font-weight: bold;
}
.icon-warning-red {
    color: #e74c3c;
    font-size: 1.2rem;
}
.txt-vacio-tabla {
    text-align: center;
    padding: 20px;
}

/* --- VISTA: MURO DE FOTOMONTAJES --- */
.grid-produccion {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tarjeta-pedido {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.tarjeta-pedido:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.tarjeta-pedido-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.tarjeta-pedido-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tarjeta-pedido-cliente {
    font-weight: 800;
    color: var(--primary, #172983);
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tarjeta-pedido-articulo {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.tarjeta-pedido-detalles {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #7f8c8d;
    border-top: 1px dashed #eee;
    padding-top: 8px;
}

.badge-cantidad {
    background-color: #f39c12;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.75rem;
}

/* --- VISTA: DETALLES FOTOMONTAJE (SUBIDA MÓVIL) --- */
.tarjeta-principal-pedido {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e1e8ed;
    align-items: center;
}

.tarjeta-principal-pedido img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.info-principal h4 {
    margin: 0 0 5px 0;
    color: var(--primary, #172983);
    font-size: 1.1rem;
}

.info-principal p {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
}

.caja-subida-movil {
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.botones-accion-foto {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-accion-foto {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: white;
}

.btn-accion-foto i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.btn-accion-foto:active {
    transform: scale(0.95);
}

.btn-galeria { background: linear-gradient(135deg, #3498db, #2980b9); box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3); }
.btn-camara { background: linear-gradient(135deg, #9b59b6, #8e44ad); box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3); }

.previsualizacion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.previsualizacion-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #2ecc71;
}

.btn-verde-gigante {
    width: 100%;
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

.galeria-gestion {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 2px dashed #eee;
    padding-bottom: 20px;
}

.foto-gestion-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.foto-gestion-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.btn-eliminar-foto {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.testigo-enviado {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(46, 204, 113, 0.9);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    padding: 3px 0;
    z-index: 10;
}

/* ==========================================================================
   VISTA: DETALLES DE PEDIDO (layout-expediente)
   ========================================================================== */

/* Layout Principal */
.layout-expediente { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.col-izq { display: flex; flex-direction: column; gap: 20px; align-self: start; }

/* Control de Bloqueo */
.capa-bloqueo input:not([type="hidden"]),
.capa-bloqueo select,
.capa-bloqueo textarea {
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
    background: #f5f5f5;
}
.capa-bloqueo button[name="GuardarPedidoCompleto"],
.capa-bloqueo button[name="AddMercancia"],
.capa-bloqueo .btn-guardar-verde[type="submit"] {
    opacity: 0.4;
    pointer-events: none;
}
.alerta-pedido-cerrado { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 15px; margin-bottom: 20px; border-radius: 4px; display: flex; align-items: center; gap: 10px; }
.alerta-pedido-cerrado i { font-size: 1.2rem; }

/* Navegación por Pestañas */
.navegacion-tabs { display: flex; border-bottom: 1px solid #ccc; background: transparent; padding: 0; margin-bottom: 0; flex-wrap: wrap; }
.tab-btn { padding: 12px 18px; border: 1px solid #ddd; background: #f1f1f1; cursor: pointer; font-weight: bold; color: #555; border-radius: 5px 5px 0 0; margin-right: 2px; border-bottom: none; font-size: 13px; margin-bottom: -1px; z-index: 1; }
.tab-btn.active { background: #fff; border-color: #ccc; border-bottom: 1px solid #fff; color: var(--primary); }
.tab-bg-alerta { background: #fff4e5; }
.tab-text-alerta { color: #d35400; }
.contenido-tab { display: none; background: #fff; border: 1px solid #ccc; padding: 25px; border-radius: 0 0 5px 5px; min-height: 480px; }
.contenido-tab.active { display: block; }

/* Grids Generales del Formulario */
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-2-col-gap20 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.grid-4-col { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 15px; }
.grid-2-1-col { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; }

/* Elementos Visuales e Imágenes */
.caja-gris-claro { background:#f9f9f9; padding:15px; border-radius:5px; border:1px solid #eee; }
.text-center-p15 { padding: 15px; text-align: center; }
.img-fluida-borde { width: 100%; border-radius: 4px; border: 1px solid #ddd; }
.area-imagen-borde { border: 1px solid #ddd; padding: 10px; text-align: center; }
.area-imagen-dashed { border: 2px dashed #ccc; padding: 10px; text-align: center; }
.img-preview-limit { max-width: 100%; max-height: 300px; }
.opacidad-30 { opacity: 0.3; }

/* Pestaña: Mercancía */
.caja-registro-mercancia { background: #f9f9f9; padding: 15px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 20px; }
.titulo-primario-m0 { margin-top: 0; color: var(--primary); }
.titulo-historial-mer { color: var(--primary); border-bottom: 1px solid #eee; padding-bottom: 10px; }
.tabla-mercancia { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; margin-top: 15px; }
.tabla-mercancia th { background: #f1f1f1; padding: 10px; border-bottom: 2px solid #ccc; color: #333; }
.tabla-mercancia td { padding: 8px 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
.badge-parcial-sm { background:#f39c12; color:#fff; padding:2px 5px; border-radius:3px; font-size:10px; }
.badge-completo-sm { background:#27ae60; color:#fff; padding:2px 5px; border-radius:3px; font-size:10px; }
.td-fecha-real { color:#aaa; font-size:11px; text-align:right; }
.grid-edicion-mercancia { display:grid; grid-template-columns: repeat(4, 1fr) 2fr 1fr; gap:10px; padding:10px; border:1px solid #ddd; margin:5px; border-radius:5px; }
.col-span-5-m0 { grid-column: span 5; margin: 0; }
.col-span-1-flex { grid-column: span 1; display: flex; gap: 5px; }
.btn-verde-flex { background:#27ae60; padding:5px; flex:1; border:none; color:white; border-radius:3px; cursor:pointer; }
.btn-gris-flex { background:#999; padding:5px; flex:1; border:none; color:white; border-radius:3px; cursor:pointer; }
.btn-guardar-verde { background:#27ae60; padding:8px 20px; border:none; color:white; font-weight:bold; cursor:pointer; border-radius:4px; white-space: nowrap; }

/* Pestaña: Cliente y Asignación */
.tab-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.info-titulo { color: var(--primary); border-bottom: 2px solid #eee; padding-bottom: 5px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.info-label { color: #888; font-size: 11px; text-transform: uppercase; font-weight: bold; margin-top: 10px; display: block; }
.info-value { font-size: 14px; color: #333; margin-bottom: 5px; display: block; border-bottom: 1px solid #f1f1f1; padding-bottom: 3px; }
.caja-reasignar { background: #fcfcfc; padding: 20px; border-radius: 8px; border: 1px solid #f1f1f1; }
.txt-ayuda-reasignar { font-size: 12px; color: #888; margin-bottom: 15px; }
.caja-asignacion { background: #fffcf5; border: 1px solid #f6e5c0; border-radius: 5px; padding: 15px; margin-bottom: 20px; }
.caja-asignacion-titulo { margin-top: 0; color: #d35400; border-bottom: 1px solid #f6e5c0; padding-bottom: 10px; }
.grid-asignacion { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 15px; }

/* Pestaña: Historial */
.contenedor-auditoria { margin-top: 10px; background-color: #fcfcfc; border: 1px solid #f1f1f1; border-radius: 8px; padding: 20px; }
.titulo-auditoria { color: var(--primary); margin-bottom: 20px; font-size: 1.1rem; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.timeline-auditoria { list-style-type: none; padding-left: 0; margin: 0; }
.item-auditoria { border-left: 3px solid #3498db; padding-left: 15px; margin-bottom: 20px; position: relative; }
.item-auditoria::before { content: ''; position: absolute; left: -7px; top: 5px; width: 11px; height: 11px; background-color: #3498db; border-radius: 50%; }
.auditoria-cabecera { display: flex; justify-content: space-between; font-size: 0.85rem; color: #7f8c8d; margin-bottom: 5px; }
.auditoria-usuario { font-weight: 600; color: #2c3e50; }
.auditoria-cuerpo { font-size: 0.95rem; color: #34495e; }
.valor-antiguo { text-decoration: line-through; color: #e74c3c; background-color: #fadbd8; padding: 2px 4px; border-radius: 3px; }
.valor-nuevo { font-weight: 600; color: #27ae60; background-color: #d5f5e3; padding: 2px 4px; border-radius: 3px; }
.caja-vacia-historial { text-align: center; color: #999; padding: 30px; }
.icono-vacio-historial { margin-bottom: 10px; color: #ddd; display: block; }

/* Pestaña: Producción */
.galeria-produccion { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; margin-top: 15px; }
.foto-produccion-item { position: relative; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.1); background: #fff; border: 1px solid #ddd; transition: transform 0.2s; }
.foto-produccion-item:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.foto-produccion-item img { width: 100%; height: 160px; object-fit: cover; display: block; cursor: pointer; }
.foto-produccion-fecha { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.7); color: white; font-size: 11px; padding: 5px; text-align: center; }
.foto-produccion-enviada { position: absolute; top: 5px; left: 5px; background: rgba(39, 174, 96, 0.9); color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: bold; z-index: 2; }
.mensaje-vacio-produccion { background:#f9f9f9; border:1px dashed #ccc; padding:30px; text-align:center; border-radius:5px; color:#777; margin-top:20px; }

/* Pestaña: Presupuestos */
.caja-presupuesto-vinculado { background: #f4f9fd; border: 1px solid #d0e3f0; border-left: 5px solid #3498db; padding: 20px; border-radius: 5px; margin-bottom: 25px; }
.cabecera-presup-vinc { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #d0e3f0; padding-bottom: 10px; margin-bottom: 15px; }
.titulo-presup-vinc { margin: 0; color: #2980b9; }
.badge-origen-pedido { background: #3498db; color: white; padding: 4px 10px; border-radius: 15px; font-size: 12px; font-weight: bold; }
.grid-4-col-items-center { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; align-items: center; }
.lbl-info-presup { display: block; font-size: 11px; color: #7f8c8d; text-transform: uppercase; font-weight: bold; }
.val-info-presup { font-size: 15px; font-weight: bold; color: #333; }
.val-info-presup-norm { font-size: 14px; color: #333; }
.val-info-presup-verde { font-size: 15px; font-weight: bold; color: #27ae60; }
.btn-ver-ficha-presup { display: inline-block; background: #fff; border: 1px solid #3498db; color: #3498db; padding: 8px 15px; border-radius: 4px; text-decoration: none; font-size: 12px; font-weight: bold; transition: all 0.2s; }
.btn-ver-ficha-presup:hover { background: #3498db; color: #fff; }
.tabla-lineas-presup { width: 100%; border-collapse: collapse; margin-top: 25px; font-size: 13px; }
.tr-head-presup { border-bottom: 2px solid #d0e3f0; color: #2980b9; text-align: left; }
.tr-body-presup { border-bottom: 1px solid #eee; }
.td-pad8 { padding: 8px; }
.td-pad8-right { padding: 8px; text-align: right; }
.td-pad8-right-bold { padding: 8px; text-align: right; font-weight: bold; }
.caja-sin-presupuesto { background: #f9f9f9; border: 1px dashed #ccc; padding: 20px; text-align: center; border-radius: 5px; margin-bottom: 25px; color: #777; }
.icono-sin-presup { font-size: 24px; margin-bottom: 10px; color: #bbb; display: block; }
.caja-vincular-presupuesto { background: #fff; border: 1px solid #eee; padding: 15px; border-radius: 5px; display: inline-block; text-align: left; }
.titulo-vincular { color: var(--primary); margin-top: 0; margin-bottom: 10px; font-size: 13px; }
.flex-align-center-gap10 { display: flex; align-items: center; gap: 10px; }
.select-vincular { width: 350px; margin: 0; }
.txt-ayuda-vincular { color: #999; display: block; margin-top: 5px; }

/* Botones y utilidades genéricas */
.btn-accion { border: none; cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; transition: background 0.2s; color: #fff; }
.btn-edit { background-color: #3498db; }
.btn-edit:hover { background-color: #2980b9; }
.btn-delete { background-color: #e74c3c; }
.btn-delete:hover { background-color: #c0392b; }
.edit-row-form { display: none; background: #fdfdfd; }
.botonera-global { display: flex; gap: 10px; margin-top: 20px; padding: 15px; background: #f4f4f4; border: 1px solid #ddd; border-radius: 5px; align-items: center; }
.flex-center-gap5 { display: flex; gap: 5px; justify-content: center; align-items: center; }
.text-right { text-align: right; }
.txt-vacio-centro { text-align: center; color: #999; }

/* --- VISTA PEDIDOS: Pestaña Montaje --- */
.titulo-montaje {
    font-size: 13px;
    color: var(--primary, #172983);
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-weight: bold;
}
.contenedor-centrado-img {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px; /* Asegura un área mínima para centrar vertical y horizontalmente */
}

/* --- VISTA PEDIDOS: Botones inferiores --- */
.btn-guardar-verde {
    display: inline-flex; align-items: center; gap: 8px;
    background: #27ae60; padding: 10px 20px; border: none;
    color: white; font-weight: bold; cursor: pointer; border-radius: 4px; text-decoration: none;
}
.btn-guardar-verde:hover { background: #219653; }

.btn-morado {
    display: inline-flex; align-items: center; gap: 8px;
    background-color: #8e44ad; color: #fff; padding: 10px 20px;
    border-radius: 4px; font-weight: bold; text-decoration: none; border: none;
}
.btn-morado:hover { background-color: #9b59b6; color: #fff; }

.btn-salir {
    display: inline-flex; align-items: center; gap: 8px;
    background-color: #7f8c8d; color: #fff; padding: 10px 20px;
    border-radius: 4px; font-weight: bold; text-decoration: none; border: none;
    margin-left: auto; /* Esto empuja el botón al extremo derecho */
}
.btn-salir:hover { background-color: #95a5a6; color: #fff; }


/* ==========================================================================
   VISTA: CREAR NUEVO PEDIDO
   ========================================================================== */
.alerta-error-top { 
    background: #fdeaea; 
    color: #e74c3c;
    border: 1px solid #e74c3c; 
    padding: 15px; 
    margin-bottom: 20px; 
    border-radius: 6px; 
}
.select2-container .select2-selection--single { 
    height: 40px !important; 
    border: 1px solid #ccc !important; 
    border-radius: 4px !important; 
    display: flex; 
    align-items: center; 
}
.select2-container--default .select2-selection--single .select2-selection__rendered { 
    line-height: 40px !important; 
    padding-left: 12px !important; 
}
.grid-cantidad-tecnica { 
    display: grid; 
    grid-template-columns: 1fr 1.5fr 1fr; 
    gap: 10px; 
}
.lbl-mini { 
    font-size: 11px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: block; 
}
.bloque-montaje-visual { 
    margin-top: 25px; 
    padding-top: 15px; 
}
.caja-previsualizacion { 
    border: 1px dashed #b5b5b5; 
    border-radius: 8px; 
    padding: 10px; 
    background: #fff; 
    min-height: 250px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
}
.caja-previsualizacion img { 
    max-width: 100%; 
    max-height: 300px; 
    object-fit: contain; 
    display: block; 
}
.btn-seleccionar-foto { 
    background-color: #5b9bd5; 
    color: white; 
    border: none; 
    padding: 12px; 
    border-radius: 5px; 
    font-size: 16px; 
    font-weight: bold; 
    cursor: pointer; 
    width: 100%; 
    margin-top: 15px; 
    transition: background 0.3s;
}
.btn-seleccionar-foto:hover {
    background-color: #4a84b8;
}
.texto-ayuda-foto { 
    text-align: center; 
    color: #999; 
    font-size: 12px; 
    margin-top: 8px; 
}
.oculto { 
    display: none !important; 
}

/* --- VISTA CREAR PEDIDO: Botón Generar --- */
.btn-lg-full {
    width: 100%;
    justify-content: center;
    font-size: 16px;
    padding: 15px;
}

/* --- VISTA REPETIR PEDIDO --- */
.campo-destacado-azul { 
    border: 2px solid #3498db !important; 
    background-color: #f8fbfe; 
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.2); 
}
.campo-destacado-azul:focus { 
    outline: none; 
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.6); 
}

/* --- VISTA REPETIR PEDIDO: Grids y etiquetas --- */
.grid-1-2-col { 
    display: grid; 
    grid-template-columns: 1fr 2fr; 
    gap: 15px; 
}
.grid-2-col-gap10 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}
.titulo-seccion-sm { 
    font-size: 14px !important; 
}
.lbl-posicion { 
    font-size: 11px; 
    display: block; 
    margin-bottom: 5px; 
    color: #888; 
    text-transform: uppercase; 
    font-weight: bold; 
}
.lbl-mini-p {
    font-size: 11px !important;
}

/* ==========================================================================
   8. BOTONERA, PESTAÑAS Y ENLACES
   ========================================================================== */
.botones-form { display: flex; gap: 15px; padding-top: 20px; border-top: 1px solid #eee; }
.botonera-global, .botonera-separada { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding: 15px; background: #f4f4f4; border: 1px solid #ddd; border-radius: 5px; }
.botonera-acciones { display: flex; gap: 15px; margin-top: 30px; padding-top: 20px; border-top: 2px solid #f0f2f5; flex-wrap: wrap; }

.guardar-btn { flex: 1; padding: 12px 20px; border: none; border-radius: 6px; background: linear-gradient(135deg, var(--success-light) 0%, var(--success) 100%); color: white; font-weight: 600; cursor: pointer; display: flex; justify-content: center; gap: 8px; transition: all 0.3s ease; }
.guardar-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(40, 167, 69, 0.35); }
.volver-btn { padding: 12px 20px; border: 1px solid #ddd; border-radius: 6px; background: #f8f9fa; color: #555; font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; min-width: 130px; }
.volver-btn:hover { background: #e2e6ea; }

/* Botones Colores */
.btn-accion, button.btn-accion, .btn-accion-linea { border: none; padding: 15px 20px; border-radius: 8px; font-weight: 600; color: white; cursor: pointer; transition: all 0.3s ease; display: inline-flex; justify-content: center; align-items: center; gap: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.btn-accion-linea { padding: 8px 15px; border-radius: 4px; box-shadow: none; }
.btn-verde, .btn-activar, .btn-convertir, .btn-aprobar { background-color: #27ae60; cursor: pointer; padding: 10px 15px; color: white; border: none; }
.btn-verde:hover, .btn-activar:hover, .btn-convertir:hover, .btn-aprobar:hover { background-color: #219150; }
.btn-rojo, .btn-salir, .btn-desactivar { background-color: #e74c3c; color: white; border: none; }
.btn-rojo:hover, .btn-salir:hover, .btn-desactivar:hover { background-color: #c0392b; }
.btn-naranja, .btn-advertencia { background-color: #f39c12; color: white; border: none; }
.btn-naranja:hover, .btn-advertencia:hover { background-color: #e67e22; }
.btn-azul, .btn-email, .btn-solicitar { background-color: #3498db; color: white; border: none; }
.btn-azul:hover, .btn-email:hover, .btn-solicitar:hover { background-color: #2980b9; }
.btn-morado { background-color: #9b59b6; color: white; border: none; }
.btn-morado:hover { background-color: #8e44ad; }
.btn-imprimir, .btn-imprimir-lg, .btn-pdf { background-color: #34495e; color: white; border: none; }
.btn-imprimir:hover, .btn-imprimir-lg:hover, .btn-pdf:hover { background-color: #2c3e50; }

.btn-flotante, .btn-masivo { position: fixed; bottom: 30px; right: 30px; z-index: 9999; background: #e74c3c; color: white; padding: 15px 30px; border-radius: 50px; font-size: 1.1em; font-weight: bold; border: none; cursor: pointer; box-shadow: 0 8px 20px rgba(0,0,0,0.4); transition: transform 0.2s ease; display: flex; align-items: center; gap: 10px; text-transform: uppercase; }
.btn-flotante:hover, .btn-masivo:hover { transform: translateY(-3px) scale(1.05); background-color: #c0392b; }

/* Botones Iconos Tabla */
.btn-accion-tabla { border: none; cursor: pointer; font-size: 12px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; transition: background 0.2s; color: #fff; }
.btn-edit { background-color: #3498db; } .btn-edit:hover { background-color: #2980b9; }
.btn-delete { background-color: #e74c3c; } .btn-delete:hover { background-color: #c0392b; }
.icon-delete { background: none; border: none; color: #e74c3c; cursor: pointer; font-size: 1.1rem; transition: color 0.2s; }
.icon-delete:hover { color: #c0392b; }

/* Pestañas Turquesa Cabecera */
.izquierda { margin-bottom: 0px; display: flex; gap: 10px; margin-left: 10px; }
.izquierda a { background-image: linear-gradient(to right, var(--primary) 0%, var(--primary-dark) 51%, var(--primary) 100%); background-size: 200% auto; padding: 10px 18px; border-radius: 8px 8px 0px 0px; color: #fff; font-size: 1.0rem; text-decoration: none; font-weight: bold; box-shadow: 0 4px 15px rgba(0, 168, 150, 0.3); display: inline-flex; align-items: center; gap: 10px; transition: 0.4s ease-out; border: none; }
.izquierda a:hover { background-position: right center; opacity: 0.9; }
.izquierda a.tab-sin-cotizar { background: #e74c3c; position: relative; }
.izquierda a.tab-sin-cotizar:hover, .izquierda a.tab-sin-cotizar.active { background: #c0392b; }
.izquierda a.tab-facturar { background: #3498db; }
.izquierda a.tab-facturar:hover, .izquierda a.tab-facturar.active { background: #2980b9; }
.izquierda a.tab-limpiar { background: #95a5a6; }
.izquierda a.tab-limpiar:hover { background: #7f8c8d; }

.globo-contador { background-color: #2c3e50; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 10px; position: absolute; top: -8px; right: -8px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.2); z-index: 10; }

/* Pestañas de Expediente (Tabs) */
.navegacion-tabs { display: flex; border-bottom: 1px solid #ccc; background: transparent; padding: 0; margin-bottom: 0; flex-wrap: wrap; }
.tab-btn { padding: 12px 18px; border: 1px solid #ddd; background: #f1f1f1; cursor: pointer; font-weight: bold; color: #555; border-radius: 5px 5px 0 0; margin-right: 2px; border-bottom: none; font-size: 13px; margin-bottom: -1px; z-index: 1; transition: all 0.2s ease; }
.tab-btn:hover { background: #f0f0f0; color: #333; }
.tab-btn.active { background: #fff; border-color: #ccc; border-bottom: 1px solid #fff; color: var(--primary); }
.contenido-tab { display: none; background: #fff; border: 1px solid #ccc; padding: 25px; border-radius: 0 0 5px 5px; min-height: 480px; animation: fadeIn 0.3s ease; }
.contenido-tab.active { display: block; }

/* Enlaces de edición en cabeceras */
.enlace-editar { color: var(--primary); font-size: 1.4em; transition: all 0.3s ease; display: inline-block; }
.enlace-editar:hover { color: var(--primary-dark); transform: translateY(-2px); }

/* --- ARTÍCULOS: Botón de borrado general del módulo --- */
.btn-borrar-modulo {
    width: 100%;
    background: transparent;
    color: #e53e3e;
    border: 1px solid #e53e3e;
    padding: 12px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s;
}
.btn-borrar-modulo:hover {
    background: #e53e3e;
    color: #ffffff;
}

/* --- Cuadrícula de 4 columnas para checkboxes (Técnicas) --- */
.grid-checkboxes-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

/* Estado Proforma */
.etiqueta-estado.etiqueta-amarilla {
    background-color: #f1c40f;
    color: #fff;
}

/* Burbujas de estado (check/x) */
.burbuja-estado {
    font-size: 1.5em; /* Ajusta el tamaño de la burbuja aquí */
}
.texto-rojo {
    color: #e74c3c;
}


/* Limitar el buscador principal a la mitad de la pantalla */
.buscador-mitad {
    width: 50%;
    min-width: 650px; /* Evita que se rompa o encoja de más en pantallas compactas */
}

/* Reparto de espacio interno dentro del flex (A prueba de Select2) */
.form-buscador-flex .select-cliente-flex + .select2-container {
    flex: 0 0 25%; /* El selector de cliente ocupa un 25% */
}

.form-buscador-flex .select-mes-flex + .select2-container,
.form-buscador-flex .select-ano-flex + .select2-container {
    flex: 0 0 14%; /* Los selectores de fecha se quedan compactos */
}

.form-buscador-flex .input-texto-libre {
    flex: 1; /* ¡REGLA DE ORO! El input se estira para ocupar todo el espacio sobrante */
}


    .alerta-bloqueado { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 15px; margin-bottom: 20px; border-radius: 4px; display: flex; align-items: center; gap: 10px; }
    .alerta-bloqueado i { font-size: 1.2rem; }
    
    .modo-lectura .proforma-sidebar, 
    .modo-lectura .contenido-tab { 
        opacity: 0.65; 
        pointer-events: none; 
        user-select: none; 
    }

    .separador-lista { border: 0; border-top: 1px dashed #ddd; margin: 12px 0; }

    /* BOTONERA ESTRUCTURADA REUTILIZADA */
    .botonera-wrapper { 
        display: flex; 
        justify-content: space-between; 
        align-items: flex-end; 
        background: #f8fafc; 
        border: 1px solid #e2e8f0; 
        border-radius: 8px; 
        padding: 20px; 
        margin-top: 25px; 
    }
    .botonera-bloque-izq { display: flex; flex-direction: column; gap: 12px; }
    .botonera-fila { display: flex; gap: 10px; flex-wrap: wrap; }
    .botonera-bloque-der { display: flex; align-items: flex-end; height: 100%; }
    
    .btn-naranja { background-color: #f39c12; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-naranja:hover { background-color: #e67e22; }
    .btn-rojo { background-color: #e74c3c; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-rojo:hover { background-color: #c0392b; }
    .btn-pdf { background-color: #34495e; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; text-decoration: none; font-size: 14px; }
    .btn-pdf:hover { background-color: #2c3e50; }
    .btn-email { background-color: #3498db; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-email:hover { background-color: #2980b9; }

    /* ESTILOS CAJA DE TOTALES (KPI) REUTILIZADA */
    .kpi-wrapper { display: flex; gap: 15px; justify-content: flex-end; flex-wrap: wrap; }
    .kpi-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px 20px; min-width: 140px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); display: flex; flex-direction: column; align-items: flex-end; transition: transform 0.2s; }
    .kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
    .kpi-label { font-size: 11px; color: #718096; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 5px; }
    .kpi-value { font-size: 19px; color: #2d3748; font-weight: 800; font-family: monospace; }
    .kpi-re { border-color: #f39c12; }
    .kpi-re .kpi-value { color: #f39c12; }
    .kpi-total { background: #2c3e50; border-color: #2c3e50; }
    .kpi-total .kpi-label { color: #cbd5e0; }
    .kpi-total .kpi-value { color: #fff; font-size: 22px; }

    .flex-center { display: flex; align-items: center; }
    .flex-between { display: flex; justify-content: space-between; align-items: center; }
    .mb-15 { margin-bottom: 15px; }
    .icon-drag { cursor: grab; color: #ccc; }
    .icon-delete { background: none; border: none; color: #dc3545; cursor: pointer; }
    .icon-delete:hover { color: #c82333; }
    .texto-gris { color: #555; font-size: 0.9em; font-weight: 500; }
    .mt-15 { margin-top: 15px; }
    .gap-10 { gap: 10px; }
    
    .col-drag { width: 30px; text-align: center; }
    .col-ped { width: 7%; } 
    .col-concepto { width: 42%; } 
    .col-cant { width: 10%; } 
    .col-precio { width: 12%; } 
    .col-iva { width: 8%; }
    .col-total { width: 10%; }
    .col-btn { width: 4%; }
    
    .input-no-spinner::-webkit-outer-spin-button, .input-no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .input-no-spinner[type=number] { -moz-appearance: textfield; }

    .swal-text-left { text-align: left; }
    .swal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .swal-form-label { display: block; text-align: left; font-size: 13px; font-weight: bold; color: #555; margin-top: 10px; margin-bottom: 5px; }
    .swal2-input-full { width: 100%; margin: 0; box-sizing: border-box; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
    .swal2-input-full:focus { border-color: #3498db; outline: none; }
    .ui-sortable-helper { display: table; background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }


/* ==========================================================================
   8. ALERTAS, ETIQUETAS Y BADGES
   ========================================================================== */
.advertencia { background-color: #fff3cd; border: 1px solid #ffeeba; color: #856404; }
.alerta-error { background: #fee; border: 1px solid #e74c3c; padding: 15px; border-radius: 5px; margin-bottom: 20px; color: #c0392b; }
.alerta-cerrado, .alerta-bloqueado { background-color: #fff3cd; color: #856404; padding: 15px; border: 1px solid #ffeeba; border-radius: 8px; margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }

/* Base Etiqueta Estado Unificada */
.etiqueta-estado { padding: 6px 12px; border-radius: 20px; font-weight: bold; font-size: 0.85em; display: inline-block; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle; }
.etiqueta-estado.gris, .etiqueta-gris { background-color: #6c757d; color: white; border: none; }
.etiqueta-estado.naranja, .etiqueta-naranja { background-color: #fd7e14; color: white; border: none; }
.etiqueta-estado.verde, .etiqueta-verde { background-color: #28a745; color: white; border: none; }
.etiqueta-estado.rojo, .etiqueta-roja { background-color: #dc3545; color: white; border: none; }
.etiqueta-estado.negro { background-color: #000; color: white; border: none; }
.etiqueta-estado.azul, .etiqueta-azul { background-color: #cce5ff; color: #004085; border: 1px solid #b8daff; }

.badge-rojo { background-color: #e74c3c; color: #ffffff; font-size: 0.70rem; font-weight: bold; padding: 2px 6px; border-radius: 50px; margin-left: 8px; display: inline-flex; align-items: center; justify-content: center; min-width: 14px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* Alertas informativas globales */
.alerta-info { background-color: #eef4ff; border-left: 4px solid #4e73df; padding: 15px; margin-bottom: 20px; border-radius: 4px; display: flex; align-items: flex-start; gap: 15px;}
.alerta-info i { color: #4e73df; font-size: 1.4em; margin-top: 2px; }
.alerta-info .info-titulo { font-weight: bold; color: #333; display: block; margin-bottom: 5px; }
.alerta-info .info-texto { font-size: 0.9em; color: #555; line-height: 1.4; }

/* ==========================================================================
   9. MÓDULOS ESPECÍFICOS (Proformas, Expedientes, Cotizador)
   ========================================================================== */
.proforma-content { background: #fff; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); padding: 25px; min-height: 500px; border: 1px solid #e1e8f0; border-left: 4px solid var(--primary); }
.fila-datos-top { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.lbl-small { font-size: 0.85em; color: #666; font-weight: 600; margin-bottom: 3px; display: block; }
.input-live { width: 100%; border: 1px solid transparent; background: transparent; padding: 5px; font-family: inherit; font-size: 0.95rem; color: #333; transition: all 0.2s; border-radius: 4px; }
.input-live:hover { border: 1px solid #e1e8f0; background: #fff; }
.input-live:focus { border: 1px solid var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 2px rgba(1, 167, 157, 0.1); }
.input-live.num { text-align: right; font-weight: 600; }

.modo-lectura .proforma-sidebar, .modo-lectura .contenido-tab { opacity: 0.65; pointer-events: none; user-select: none; }
.modo-lectura .input-live { border: none !important; background: transparent !important; pointer-events: none; color: #555; -webkit-appearance: none; appearance: none; }

/* Fotos / Montajes */
.area-imagen { border: 1px solid #ddd; border-radius: 8px; padding: 15px; background: #f9f9f9; text-align: center; display: flex; flex-direction: column; justify-content: center; min-height: 350px; }
.area-imagen img, .img-expediente { max-width: 100%; max-height: 400px; object-fit: contain; border-radius: 4px; }
.foto-revision { width: 100%; max-width: 250px; border-radius: 8px; border: 2px solid #eee; margin-top: 10px; background: #f8fafc; transition: transform 0.2s ease; }
.foto-clicable { cursor: pointer; }
.foto-clicable:hover { transform: scale(1.03); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* Cotizador / Kanban */
.dashboard-stats { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.stat-card { flex: 1; min-width: 180px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-sm); padding: 20px; text-align: center; cursor: pointer; transition: transform 0.2s; border: 1px solid var(--border-color); }
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.kanban-board { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 10px; margin-top: 20px; }
.kanban-col { flex: 1; min-width: 300px; background: #f4f6f9; border-radius: 12px; padding: 15px; border: 1px solid #e2e8f0; }
.k-card { background: #fff; padding: 15px; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border-left: 4px solid #ccc; cursor: pointer; }

/* IA y Preview */
.btn-ia { background: linear-gradient(135deg, #8e44ad, #3498db); color: white; border: none; padding: 8px 15px; border-radius: 5px; font-weight: bold; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: transform 0.2s; }
.btn-ia:hover { transform: scale(1.05); }

/* ==========================================================================
   10. MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */
@media (max-width: 1400px) { .grid-4-columnas { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 1250px) {
    .navbar-top { justify-content: space-between; padding: 0 15px; }
    .mobile-toggle, .btn-logout-mobile { display: block; font-size: 1.4rem; color: #fff; cursor: pointer; }
    .nav-logo { margin: 0 auto; }
    .desktop-only { display: none !important; }
    .nav-menu { position: fixed; top: 70px; left: -100%; width: 85%; height: calc(100vh - 70px); background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%); flex-direction: column; transition: left 0.3s ease; overflow-y: auto; padding: 0; }
    .nav-menu.active { left: 0; }
    .bloque1, .bloque2 { width: 100%; float: none; margin-right: 0; }
    form.buscador, .form-buscador-flex { display: flex !important; flex-direction: row !important; width: 100%; gap: 5px; }
    table.listado { display: table !important; width: 100% !important; table-layout: fixed; }
    .listado td, .listado th { font-size: 0.8rem; }
    .login-visual { display: none !important; }
}

@media (max-width: 900px) {
    .layout-proforma, .layout-expediente { grid-template-columns: 1fr; }
    .proforma-sidebar, .col-izq { order: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .proforma-content { order: 2; }
}

@media (max-width: 768px) {
    div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}




    .alerta-bloqueado { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 15px; margin-bottom: 20px; border-radius: 4px; display: flex; align-items: center; gap: 10px; }
    .alerta-bloqueado i { font-size: 1.2rem; }
    
    .modo-lectura .proforma-sidebar, 
    .modo-lectura .contenido-tab { 
        opacity: 0.65; 
        pointer-events: none; 
        user-select: none; 
    }

    .separador-lista { border: 0; border-top: 1px dashed #ddd; margin: 12px 0; }

    .botonera-wrapper { 
        display: flex; 
        justify-content: space-between; 
        align-items: flex-end; 
        background: #f8fafc; 
        border: 1px solid #e2e8f0; 
        border-radius: 8px; 
        padding: 20px; 
        margin-top: 25px; 
    }
    .botonera-bloque-izq { display: flex; flex-direction: column; gap: 12px; }
    .botonera-fila { display: flex; gap: 10px; flex-wrap: wrap; }
    .botonera-bloque-der { display: flex; align-items: flex-end; height: 100%; }
    
    .btn-naranja { background-color: #f39c12; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-naranja:hover { background-color: #e67e22; }
    .btn-rojo { background-color: #e74c3c; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-rojo:hover { background-color: #c0392b; }
    .btn-pdf { background-color: #34495e; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; text-decoration: none; font-size: 14px; }
    .btn-pdf:hover { background-color: #2c3e50; }
    .btn-email { background-color: #3498db; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-email:hover { background-color: #2980b9; }
    .btn-verde { background-color: #27ae60; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-verde:hover { background-color: #219653; }

    .kpi-wrapper { display: flex; gap: 15px; justify-content: flex-end; flex-wrap: wrap; }
    .kpi-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px 20px; min-width: 140px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); display: flex; flex-direction: column; align-items: flex-end; transition: transform 0.2s; }
    .kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
    .kpi-label { font-size: 11px; color: #718096; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 5px; }
    .kpi-value { font-size: 19px; color: #2d3748; font-weight: 800; font-family: monospace; }
    .kpi-re { border-color: #f39c12; }
    .kpi-re .kpi-value { color: #f39c12; }
    .kpi-total { background: #2c3e50; border-color: #2c3e50; }
    .kpi-total .kpi-label { color: #cbd5e0; }
    .kpi-total .kpi-value { color: #fff; font-size: 22px; }

    .flex-center { display: flex; align-items: center; }
    .flex-between { display: flex; justify-content: space-between; align-items: center; }
    .mb-15 { margin-bottom: 15px; }
    .icon-drag { cursor: grab; color: #ccc; }
    .icon-delete { background: none; border: none; color: #dc3545; cursor: pointer; }
    .icon-delete:hover { color: #c82333; }
    .texto-gris { color: #555; font-size: 0.9em; font-weight: 500; }
    .texto-verde { color: #27ae60; }
    .mt-15 { margin-top: 15px; }
    .gap-10 { gap: 10px; }
    
    .col-drag { width: 30px; text-align: center; }
    .col-ped { width: 7%; } 
    .col-concepto { width: 42%; } 
    .col-cant { width: 10%; } 
    .col-precio { width: 12%; } 
    .col-iva { width: 8%; }
    .col-total { width: 10%; }
    .col-btn { width: 4%; }
    
    .input-no-spinner::-webkit-outer-spin-button, .input-no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .input-no-spinner[type=number] { -moz-appearance: textfield; }

    .swal-text-left { text-align: left; }
    .swal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .swal-form-label { display: block; text-align: left; font-size: 13px; font-weight: bold; color: #555; margin-top: 10px; margin-bottom: 5px; }
    .swal2-input-full { width: 100%; margin: 0; box-sizing: border-box; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
    .swal2-input-full:focus { border-color: #3498db; outline: none; }
    .ui-sortable-helper { display: table; background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

    .tab-oculto { display: none; }
    .limpio-buffer { padding-top: 15px; text-align: left; }
    .ancho-completo-sidebar { width: 100%; }
    .amarillo-proforma { background-color: #f1c40f; color: #fff; }




    .bloque-nuevo-albaran { margin-top: 20px; }
    .alerta-info-albaran { background-color: #e8f4fd; border-left: 4px solid #3498db; padding: 15px; margin-bottom: 20px; }



/* Clases para el bloqueo visual */
    .alerta-bloqueado { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 15px; margin-bottom: 20px; border-radius: 4px; display: flex; align-items: center; gap: 10px; }
    .alerta-bloqueado i { font-size: 1.2rem; }
    
    .modo-lectura .proforma-sidebar, 
    .modo-lectura .contenido-tab { 
        opacity: 0.65; 
        pointer-events: none; 
        user-select: none; 
    }

    .separador-lista { border: 0; border-top: 1px dashed #ddd; margin: 12px 0; }

    /* BOTONERA ESTRUCTURADA */
    .botonera-wrapper { 
        display: flex; 
        justify-content: space-between; 
        align-items: flex-end; 
        background: #f8fafc; 
        border: 1px solid #e2e8f0; 
        border-radius: 8px; 
        padding: 20px; 
        margin-top: 25px; 
    }
    .botonera-bloque-izq { display: flex; flex-direction: column; gap: 12px; }
    .botonera-fila { display: flex; gap: 10px; flex-wrap: wrap; }
    .botonera-bloque-der { display: flex; align-items: flex-end; height: 100%; }
    
    .btn-naranja { background-color: #f39c12; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-naranja:hover { background-color: #e67e22; }
    .btn-rojo { background-color: #e74c3c; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-rojo:hover { background-color: #c0392b; }
    .btn-pdf { background-color: #34495e; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; text-decoration: none; font-size: 14px; }
    .btn-pdf:hover { background-color: #2c3e50; }
    .btn-email { background-color: #3498db; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-email:hover { background-color: #2980b9; }

    /* ESTILOS CAJA DE TOTALES (KPI) */
    .caja-descuento { background: #f8fafc; padding: 15px; border-radius: 8px; border: 1px dashed #cbd5e0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 15px; }
    .kpi-wrapper { display: flex; gap: 15px; justify-content: flex-end; flex-wrap: wrap; }
    .kpi-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px 20px; min-width: 140px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); display: flex; flex-direction: column; align-items: flex-end; transition: transform 0.2s; }
    .kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
    .kpi-label { font-size: 11px; color: #718096; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 5px; }
    .kpi-value { font-size: 19px; color: #2d3748; font-weight: 800; font-family: monospace; }
    .kpi-re { border-color: #f39c12; }
    .kpi-re .kpi-value { color: #f39c12; }
    .kpi-total { background: #2c3e50; border-color: #2c3e50; }
    .kpi-total .kpi-label { color: #cbd5e0; }
    .kpi-total .kpi-value { color: #fff; font-size: 22px; }

    /* Clases utilitarias */
    .flex-center { display: flex; align-items: center; }
    .flex-between { display: flex; justify-content: space-between; align-items: center; }
    .mb-15 { margin-bottom: 15px; }
    .icon-drag { cursor: grab; color: #ccc; }
    .icon-delete { background: none; border: none; color: #dc3545; cursor: pointer; }
    .icon-delete:hover { color: #c82333; }
    .texto-gris { color: #555; font-size: 0.9em; font-weight: 500; }
    .text-small { font-size: 0.9em; }
    .mt-15 { margin-top: 15px; }
    .gap-10 { gap: 10px; }
    .btn-info-custom { background-color: #17a2b8; border-color: #17a2b8; }
    .btn-info-custom:hover { background-color: #138496; border-color: #117a8b; }
    
    .col-drag { width: 30px; text-align: center; }
    .col-ped { width: 7%; } 
    .col-concepto { width: 42%; } 
    .col-cant { width: 10%; } 
    .col-precio { width: 12%; } 
    .col-iva { width: 8%; }
    .col-total { width: 10%; }
    .col-btn { width: 4%; }
    
    .input-no-spinner::-webkit-outer-spin-button, .input-no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .input-no-spinner[type=number] { -moz-appearance: textfield; }

    .swal-text-left { text-align: left; }
    .swal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .swal-form-label { display: block; text-align: left; font-size: 13px; font-weight: bold; color: #555; margin-top: 10px; margin-bottom: 5px; }
    .swal2-input-full { width: 100%; margin: 0; box-sizing: border-box; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
    .swal2-input-full:focus { border-color: #3498db; outline: none; }
    .ui-sortable-helper { display: table; background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

    /* Estilos para los iconos de pago */
    .icono-pagado { color: #28a745; font-size: 1.4em; }
    .icono-parcial { color: #ffc107; font-size: 1.4em; }
    .icono-pendiente { color: #dc3545; font-size: 1.4em; }

    /* Colores condicionales para el total */
    .total-positivo { color: #28a745; font-weight: bold; }
    .total-negativo { color: #dc3545; font-weight: bold; }

    /* Ajuste del botón de filtrar para que icono y texto encajen */
    .btn-filtrar-principal { 
        width: auto; 
        min-width: 120px; 
        padding: 8px 15px; 
        white-space: nowrap; 
        display: inline-flex; 
        align-items: center; 
        justify-content: center; 
        gap: 8px; 
        font-weight: bold;
    }

    /* Estilos para los inputs de cabecera */
    .input-header { width: 100%; padding: 4px; border: 1px solid #ddd; border-radius: 3px; font-size: 0.85em; box-sizing: border-box; }
    .select-header { width: 100%; padding: 3px; border: 1px solid #ddd; border-radius: 3px; font-size: 0.85em; }
    
    .listado thead tr.filtros-header th { padding: 5px; background: #f8f9fa; }
    
    /* Estilos para la cabecera ordenable */
    .th-sortable { color: inherit; text-decoration: none; display: flex; align-items: center; justify-content: space-between; gap: 5px; font-weight: bold; }
    .th-sortable:hover { color: #0056b3; text-decoration: none; }
    .sort-icon-muted { color: #ccc; opacity: 0.5; }
    
    /* Estilo específico columna "Último Cambio" */
    .col-ultimo-cambio { color: #888; font-size: 0.8em; line-height: 1.2; }


/* Clases para el bloqueo visual */
    .alerta-bloqueado { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 15px; margin-bottom: 20px; border-radius: 4px; display: flex; align-items: center; gap: 10px; }
    .alerta-bloqueado i { font-size: 1.2rem; }
    
    .modo-lectura .proforma-sidebar, 
    .modo-lectura .contenido-tab { 
        opacity: 0.65; 
        pointer-events: none; 
        user-select: none; 
    }

    .separador-lista { border: 0; border-top: 1px dashed #ddd; margin: 12px 0; }

    /* BOTONERA ESTRUCTURADA */
    .botonera-wrapper { 
        display: flex; 
        justify-content: space-between; 
        align-items: flex-end; 
        background: #f8fafc; 
        border: 1px solid #e2e8f0; 
        border-radius: 8px; 
        padding: 20px; 
        margin-top: 25px; 
    }
    .botonera-bloque-izq { display: flex; flex-direction: column; gap: 12px; }
    .botonera-fila { display: flex; gap: 10px; flex-wrap: wrap; }
    .botonera-bloque-der { display: flex; align-items: flex-end; height: 100%; }
    
    .btn-naranja { background-color: #f39c12; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-naranja:hover { background-color: #e67e22; }
    .btn-rojo { background-color: #e74c3c; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-rojo:hover { background-color: #c0392b; }
    .btn-pdf { background-color: #34495e; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; text-decoration: none; font-size: 14px; }
    .btn-pdf:hover { background-color: #2c3e50; }
    .btn-email { background-color: #3498db; color: #fff; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; border: none; font-size: 14px; }
    .btn-email:hover { background-color: #2980b9; }

    /* ESTILOS CAJA DE TOTALES (KPI) */
    .caja-descuento { background: #f8fafc; padding: 15px; border-radius: 8px; border: 1px dashed #cbd5e0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 15px; }
    .kpi-wrapper { display: flex; gap: 15px; justify-content: flex-end; flex-wrap: wrap; }
    .kpi-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px 20px; min-width: 140px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); display: flex; flex-direction: column; align-items: flex-end; transition: transform 0.2s; }
    .kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
    .kpi-label { font-size: 11px; color: #718096; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 5px; }
    .kpi-value { font-size: 19px; color: #2d3748; font-weight: 800; font-family: monospace; }
    .kpi-re { border-color: #f39c12; }
    .kpi-re .kpi-value { color: #f39c12; }
    .kpi-total { background: #2c3e50; border-color: #2c3e50; }
    .kpi-total .kpi-label { color: #cbd5e0; }
    .kpi-total .kpi-value { color: #fff; font-size: 22px; }

    /* Clases utilitarias */
    .flex-center { display: flex; align-items: center; }
    .flex-between { display: flex; justify-content: space-between; align-items: center; }
    .mb-15 { margin-bottom: 15px; }
    .icon-drag { cursor: grab; color: #ccc; }
    .icon-delete { background: none; border: none; color: #dc3545; cursor: pointer; }
    .icon-delete:hover { color: #c82333; }
    .texto-gris { color: #555; font-size: 0.9em; font-weight: 500; }
    .mt-15 { margin-top: 15px; }
    .gap-10 { gap: 10px; }
    
    .col-drag { width: 30px; text-align: center; }
    .col-ped { width: 7%; } 
    .col-concepto { width: 42%; } 
    .col-cant { width: 10%; } 
    .col-precio { width: 12%; } 
    .col-iva { width: 8%; }
    .col-total { width: 10%; }
    .col-btn { width: 4%; }
    
    .input-no-spinner::-webkit-outer-spin-button, .input-no-spinner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .input-no-spinner[type=number] { -moz-appearance: textfield; }

    .swal-text-left { text-align: left; }
    .swal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .swal-form-label { display: block; text-align: left; font-size: 13px; font-weight: bold; color: #555; margin-top: 10px; margin-bottom: 5px; }
    .swal2-input-full { width: 100%; margin: 0; box-sizing: border-box; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
    .swal2-input-full:focus { border-color: #3498db; outline: none; }
    .ui-sortable-helper { display: table; background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
	
	
	.capa-bloqueo .botonera-global a,
.capa-bloqueo #tab-produccion,
.capa-bloqueo .tab-btn[data-target="#tab-produccion"] {
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
}

.capa-bloqueo .navegacion-tabs .tab-btn {
    opacity: 1;
    pointer-events: auto;
}

.capa-bloqueo input:not([type="hidden"]),
.capa-bloqueo select,
.capa-bloqueo textarea,
.capa-bloqueo button[name="GuardarPedidoCompleto"],
.capa-bloqueo button[type="submit"] {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}


/* Estilos extraídos de Pedidos sin Mercancía */
.col-foto { width: 60px; text-align: center; }
.col-center { text-align: center; }
.nowrap { white-space: nowrap; }
.texto-comercial { font-size: 0.85em; color: var(--primary, #3498db); font-weight: 600; display: block; margin-top: 4px; }

.img-miniatura { width: 45px; height: 45px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid #eee; }
.img-opaca { opacity: 0.3; }

.icon-mercancia { color: #e67e22; font-size: 1.2rem; transition: transform 0.2s; }
.icon-mercancia:hover { transform: scale(1.15); color: #d35400; }

.paginacion-wrapper { display: flex; justify-content: center; margin-top: 30px; }
.paginacion { display: flex; list-style: none; padding: 0; margin: 0; gap: 5px; }
.paginacion li a { display: flex; align-items: center; justify-content: center; min-width: 35px; height: 35px; padding: 0 10px; background: #fff; border: 1px solid #ddd; border-radius: 4px; color: #333; text-decoration: none; font-weight: bold; transition: all 0.2s; }
.paginacion li.active a, .paginacion li a:hover { background: #3498db; color: #fff; border-color: #3498db; }
.paginacion li.btn a { background: #f1f5f9; color: #64748b; }
.paginacion li.btn a:hover { background: #e2e8f0; color: #334155; }

.fila-vacia { text-align: center; padding: 30px; color: #777; font-weight: 500; }
.alerta-roja { background-color: #ffe6e6; border: 2px solid #e74c3c; color: #c0392b; padding: 20px; border-radius: 8px; margin: 20px 0; font-size: 1.1em; }

/* Nuevas clases de remaquetación (reemplazo de estilos en línea) */
.buscador-principal-wrapper { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.buscador-form { margin: 0; display: flex; align-items: center; }
.buscador-select { width: 250px; margin-right: 15px; }
.buscador-input { min-width: 300px; margin-right: 15px; }



/* ═══════════════════════════════════════════════════════════
   Dashboard Admin — index_admin.css
   ═══════════════════════════════════════════════════════════ */

/* ── Accesos rápidos ──────────────────────────────────────── */
.accesos-rapidos {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.btn-acceso {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: #fff;
    border: 1px solid #dde1e7;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: background 0.15s, border-color 0.15s;
}
.btn-acceso:hover {
    background: #f5f7fa;
    border-color: #b0b8c4;
    color: #111;
    text-decoration: none;
}
.btn-acceso i {
    font-size: 16px;
    color: #6c757d;
}

/* ── Filtro ───────────────────────────────────────────────── */
.filtro-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.filtro-bar-titulo {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #6c757d;
}
.filtro-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.filtro-form select {
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #dde1e7;
    border-radius: 6px;
    background: #fff;
    color: #333;
}
.filtro-form button {
    font-size: 13px;
    padding: 6px 16px;
    border: 1px solid #4e73df;
    border-radius: 6px;
    background: #4e73df;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}
.filtro-form button:hover {
    background: #375bb5;
}

/* ── KPI Grid ─────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.kpi-card {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.15s;
}
.kpi-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.09);
}
.kpi-card.alerta .kpi-value {
    color: #c0392b;
}
.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-bottom: 6px;
}
.kpi-icon.azul  { background: #e8f0fd; color: #2d5fcf; }
.kpi-icon.verde { background: #e6f5ec; color: #1e7e44; }
.kpi-icon.ambar { background: #fef5e4; color: #b07d18; }
.kpi-icon.rojo  { background: #fdecea; color: #c0392b; }
.kpi-icon.teal  { background: #e0f5f0; color: #0e7a65; }
.kpi-icon.gris  { background: #f0f2f5; color: #6c757d; }
.kpi-label {
    font-size: 11px;
    color: #9aa0ac;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.kpi-value {
    font-size: 21px;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
}
.kpi-sub {
    font-size: 12px;
    color: #9aa0ac;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.kpi-sub .ok { color: #1e7e44; font-weight: 500; }
.kpi-sub .ko { color: #c0392b; font-weight: 500; }

/* ── Gráficas ─────────────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}
.chart-box {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.chart-box-titulo {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 12px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .charts-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}


/*MENU*/
@media (max-width: 1250px) {

    .nav-menu {
        position: fixed !important;
        top: 70px !important;
        left: -100% !important;
        width: 85% !important;
        height: calc(100vh - 70px) !important;
        background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transition: left 0.3s ease !important;
        z-index: 1000 !important;
        padding: 0 !important;
        margin: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }

    .nav-menu.active {
        left: 0 !important;
    }

    .nav-list {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        align-items: flex-start !important;
    }

    .nav-item {
        width: 100% !important;
        height: auto !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        display: block !important;
    }

    .nav-link {
        width: 100% !important;
        padding: 14px 20px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        color: #fff !important;
        box-sizing: border-box !important;
    }

    .nav-link:hover {
        background: rgba(255,255,255,0.1) !important;
    }

    /* ACORDEÓN: submenú se expande hacia abajo inline */
    .dropdown-menu {
        position: static !important;
        display: none !important;
        background: rgba(0,0,0,0.25) !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        min-width: unset !important;
        width: 100% !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
    }

    /* Quitar el hover del desktop que abría el dropdown */
    .nav-item:hover .dropdown-menu {
        display: none !important;
    }

    /* Solo abrir cuando tiene la clase mobile-open */
    .has-drop.mobile-open .dropdown-menu {
        display: block !important;
    }

    .dropdown-item {
        padding: 12px 20px 12px 45px !important;
        color: rgba(255,255,255,0.85) !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .dropdown-item:hover {
        background: rgba(255,255,255,0.1) !important;
        color: #fff !important;
    }

    .dropdown-item i {
        color: rgba(255,255,255,0.7) !important;
        width: 20px !important;
    }

    /* Rotar el chevron cuando está abierto */
    .has-drop.mobile-open > .nav-link .fa-chevron-down {
        transform: rotate(180deg);
        transition: transform 0.2s ease;
    }

    .fa-chevron-down {
        transition: transform 0.2s ease;
    }

    /* FIX contenido derecha */
    body { overflow-x: hidden !important; }
    .contenido { width: 100% !important; padding: 0 8px !important; overflow-x: hidden !important; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .charts-grid { grid-template-columns: 1fr !important; }
    .accesos-rapidos { gap: 8px !important; }
    .btn-acceso { font-size: 13px !important; padding: 8px 12px !important; }

    /* Info usuario móvil */
    .mobile-user-info { display: block !important; padding: 15px 20px !important; border-bottom: 1px solid rgba(255,255,255,0.2) !important; }
    .mobile-divider { display: block !important; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr 1fr !important; }
    .kpi-value { font-size: 17px !important; }
}




/* ==========================================================================
   11. PORTAL DEL EMPLEADO (.pe-)
   ========================================================================== */
.pe-contenedor { padding: 20px; max-width: 2100px; margin: 0 auto; font-family: var(--font-alt); margin-top: -80px; }
.pe-cabecera { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px solid #e0e0e0; }
.pe-saludo { font-size: 1.8rem; color: #333; font-weight: 300; }
.pe-saludo strong { font-weight: 700; color: var(--primary); }
.pe-subtitulo { display: block; margin-top: 5px; color: #777; font-size: 0.95rem; }
.pe-nav-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }

/* Grid PE */
.pe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; width: 100%; }

/* Botones Home PE */
.pe-boton {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background-color: #ffffff; padding: 40px 20px; border-radius: 16px; text-decoration: none !important;
    border: 1px solid #e0e0e0; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; overflow: hidden; height: 100%; min-height: 220px;
}
.pe-texto { font-size: 1.4rem; font-weight: 700; color: #444; text-align: center; line-height: 1.3; margin-top: 20px; z-index: 2; }
.pe-icono { font-size: 4rem; margin-bottom: 10px; transition: transform 0.3s ease; z-index: 2; }

/* Colores Secciones PE */
.pe-serigrafia { border-bottom: 6px solid #e74c3c; } .pe-serigrafia .pe-icono { color: #e74c3c; }
.pe-serigrafia:hover { background-color: #fdf3f2; border-color: #e74c3c; }
.pe-tampografia { border-bottom: 6px solid #3498db; } .pe-tampografia .pe-icono { color: #3498db; }
.pe-tampografia:hover { background-color: #f0f7fb; border-color: #3498db; }
.pe-digital { border-bottom: 6px solid #9b59b6; } .pe-digital .pe-icono { color: #9b59b6; }
.pe-digital:hover { background-color: #f7f1f9; border-color: #9b59b6; }
.pe-dtf { border-bottom: 6px solid #f39c12; } .pe-dtf .pe-icono { color: #f39c12; }
.pe-dtf:hover { background-color: #fefcf5; border-color: #f39c12; }

.pe-boton:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.pe-boton:hover .pe-icono { transform: scale(1.1); }
.pe-boton:active { transform: scale(0.96); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Tarjetas Usuario PE */
.pe-card-user {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; padding: 25px 15px; border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee; text-decoration: none !important; transition: transform 0.2s, box-shadow 0.2s;
    height: 100%; min-height: 160px;
}
.pe-card-user .pe-icono-user { font-size: 2.5rem; color: #a0aec0; margin-bottom: 12px; transition: color 0.2s; }
.pe-card-user .pe-nombre { font-size: 1.1rem; font-weight: 600; color: #2d3748; text-align: center; line-height: 1.2; }
.pe-card-user:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-color: var(--primary); }
.pe-card-user:hover .pe-icono-user { color: var(--primary); }
.pe-card-special { background-color: #fff8e1; border-color: #ffe082; }
.pe-card-special .pe-icono-user { color: #f39c12; }

/* Tarjetas Trabajo PE */
.pe-job-card {
    background: #ffffff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); border: 1px solid #e0e0e0;
    display: flex; flex-direction: column; text-decoration: none !important; overflow: hidden; position: relative; transition: transform 0.2s;
}
.pe-job-card:active { transform: scale(0.98); }
.pe-job-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #f8f9fa; border-bottom: 1px solid #eee; }
.pe-header-left { display: flex; gap: 10px; align-items: center; }
.pe-priority {
    font-size: 1.4rem; font-weight: 800; color: var(--primary); background: #fff; padding: 2px 10px;
    border-radius: 6px; border: 1px solid rgba(1, 167, 157, 0.2); box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.pe-date { font-weight: 600; color: #666; font-size: 0.9rem; }

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}
.tag-express {
    background: #e74c3c; color: #fff; font-weight: 700; font-size: 0.85rem; padding: 5px 12px;
    border-radius: 50px; display: inline-flex; align-items: center; gap: 5px; text-transform: uppercase; animation: pulse-red 2s infinite;
}

.pe-img-container { width: 100%; height: 250px; background-color: #f4f4f4; display: flex; justify-content: center; align-items: center; border-bottom: 1px solid #eee; padding: 10px; }
.pe-job-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
.pe-job-info { padding: 20px; text-align: center; }
.pe-client { font-size: 0.9rem; color: #888; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.pe-product { font-size: 1.4rem; color: #2d3748; font-weight: 700; line-height: 1.3; }
.pe-job-footer { padding: 0 20px 20px 20px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pe-tag { font-size: 0.9rem; padding: 8px 14px; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tag-qty { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.tag-loc { background: #fff3e0; color: #ef6c00; border: 1px solid #ffe0b2; }
.tag-rep { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.tag-new { background: #e0f7fa; color: #006064; border: 1px solid #b2ebf2; }

/* Detalle PE */
.pe-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.pe-info-card { background: #fff; border-radius: 16px; padding: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border: 1px solid #eee; }
.pe-detail-img-container {
    width: 100%; height: 350px; background: #f4f4f4; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 20px; border: 1px solid #ddd;
}
.pe-detail-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pe-data-list { margin: 0; padding: 0; list-style: none; }
.pe-data-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed #eee; font-size: 1rem; }
.pe-data-row:last-child { border-bottom: none; }
.pe-label { color: #888; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pe-value { color: #333; font-weight: 700; text-align: right; }

/* Acciones PE */
.pe-actions-container { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 10px; }
.pe-big-action {
    display: flex; align-items: center; justify-content: center; gap: 15px; padding: 25px;
    border-radius: 16px; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; text-decoration: none !important;
    transition: transform 0.2s; box-shadow: 0 5px 15px rgba(0,0,0,0.1); border: none; cursor: pointer;
}
.pe-big-action:active { transform: scale(0.96); }
.act-start { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; }
.act-pause { background: linear-gradient(135deg, #f39c12, #d35400); color: #fff; }
.act-finish { background: linear-gradient(135deg, #34495e, #2c3e50); color: #fff; }

/* Inputs QTY PE */
.pe-input-qty-group { margin-bottom: 20px; }
.pe-input-qty-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.95rem; }
.pe-input-qty {
    width: 100%; padding: 15px; font-size: 1.4rem; border: 2px solid #e0e0e0; border-radius: 10px;
    text-align: center; transition: all 0.3s; background: #fdfdfd;
}
.pe-input-qty:focus { outline: none; border-color: var(--primary); background: #fff; }
.input-good:focus { border-color: #27ae60; }
.input-bad { color: #e74c3c; background: #fdf2f2; } .input-bad:focus { border-color: #e74c3c; }
.input-warn { color: #f39c12; background: #fefcf5; } .input-warn:focus { border-color: #f39c12; }

/* Team Grid PE */
.pe-team-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 25px; }
.pe-team-checkbox { display: none; }
.pe-team-label {
    padding: 10px 18px; background: #f0f2f5; color: #555; border-radius: 50px; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; border: 1px solid #e0e0e0; user-select: none; display: flex; align-items: center; gap: 8px;
}
.pe-team-checkbox:checked + .pe-team-label {
    background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(1, 167, 157, 0.3);
}
.pe-team-checkbox:checked + .pe-team-label:before { content: "\f00c"; font-family: "Font Awesome 5 Free"; font-weight: 900; }

.pe-counter { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.85rem; margin-top: 8px; padding: 4px 12px; border-radius: 20px; transition: all 0.2s; }
.pe-counter-active { color: #e67e22; background-color: #fff8ec; font-weight: 700; border: 1px solid #fae5d3; }
.pe-counter-idle { color: #a0aec0; background-color: transparent; font-weight: 500; }
.pe-counter-urgent { color: #c0392b; background-color: #fdedec; font-weight: 700; border: 1px solid #fadbd8; }

.pe-header-unified {
    display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0; flex-wrap: wrap; gap: 15px;
}
.pe-header-title-block { text-align: right; }
.pe-main-title { font-size: 1.5rem; font-weight: 700; color: #333; margin: 0; line-height: 1.1; }
.pe-section-tag { display: block; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* Lightbox */
.pe-lightbox {
    display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%;
    overflow: hidden; background-color: rgba(0,0,0,0.95); justify-content: center; align-items: center; flex-direction: column;
}
.pe-lightbox-content { margin: auto; display: block; max-width: 95%; max-height: 85vh; border-radius: 8px; box-shadow: 0 0 20px rgba(255,255,255,0.1); object-fit: contain; }
.pe-lightbox-close {
    position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold;
    cursor: pointer; transition: 0.3s; background: rgba(0,0,0,0.5); width: 50px; height: 50px; text-align: center; line-height: 50px; border-radius: 50%;
}
.pe-lightbox-close:hover { color: #bbb; background: rgba(255,255,255,0.1); }
.pe-zoomable { cursor: zoom-in; transition: transform 0.2s; }
.pe-zoomable:hover { transform: scale(1.02); }

/* Grid Empleados (Checkboxes visuales) */
.grid-empleados { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.chk-empleado { display: none; }
.lbl-empleado {
    display: flex; align-items: center; justify-content: center; padding: 8px 5px; background: #fff;
    border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-weight: 600;
    color: #555; text-align: center; transition: all 0.2s ease; user-select: none; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.lbl-empleado:hover { background: #f0f0f0; border-color: #bbb; }
.chk-empleado:checked + .lbl-empleado {
    background: var(--info); color: #fff; border-color: #2980b9; box-shadow: 0 2px 5px rgba(52, 152, 219, 0.4); transform: translateY(-1px);
}


.kpi-total {
    background: #2c3e50 !important;
    border-color: #2c3e50 !important;
}
.kpi-total .kpi-label {
    color: #cbd5e0 !important;
}
.kpi-total .kpi-value {
    color: #ffffff !important;
}



@media (max-width: 1100px) {
    .grid-asignacion {
        grid-template-columns: 1fr !important;
    }
    .bloque-inferior-kanban {
        grid-template-columns: 1fr !important;
    }
}




































/* ==========================================================================
   11. DUPLICADOS Y CÓDIGO LEGACY COMENTADOS (BACKUP)
   ========================================================================== */
/*
.btn-add-tech { background: #eee; border: 1px solid #ccc; color: #333; width: 100%; text-align: center; padding: 8px; }
.btn-solicitar { background: #3498db; border-color: #3498db; color: white; width: 100%; }
.lbl-small { font-size: 0.85em; color: #666; font-weight: 600; margin-bottom: 3px; display: block; }
.modo-lectura .input-live.num { text-align: right; }
.etiqueta-estado { padding: 5px 10px; border-radius: 4px; color: white; font-weight: bold; font-size: 12px; display: inline-block; margin-left: 10px; vertical-align: middle; }
.etiqueta-estado { padding: 5px 10px; border-radius: 4px; color: white; font-weight: bold; font-size: 11px; display: inline-block; vertical-align: middle; margin-left: 10px; text-transform: uppercase; }
.etiqueta-estado.gris { background-color: #6c757d; }
.etiqueta-estado.naranja { background-color: #fd7e14; }
.etiqueta-estado.verde { background-color: #28a745; }
.etiqueta-estado.rojo { background-color: #dc3545; }
.layout-expediente { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.col-izq { display: flex; flex-direction: column; gap: 20px; align-self: start; }
.navegacion-tabs { display: flex; border-bottom: 1px solid #ccc; flex-wrap: wrap; }
.tab-btn { padding: 10px 15px; border: 1px solid transparent; background: #eee; cursor: pointer; font-weight: bold; color: #555; border-radius: 5px 5px 0 0; margin-right: 3px; font-family: inherit; font-size: 12px; }
.tab-btn.active { background: #fff; border: 1px solid #ccc; border-bottom-color: #fff; color: #004c8c; }
.contenido-tab { display: none; background: #fff; border: 1px solid #ccc; padding: 25px; border-radius: 0 5px 5px 5px; min-height: 480px; }
.contenido-tab.active { display: block; }
.campoform { margin-top: 5px; margin-bottom: 5px; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.layout-expediente { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.col-izq { display: flex; flex-direction: column; gap: 20px; align-self: start; }
.navegacion-tabs { display: flex; border-bottom: 1px solid #ccc; background: transparent; padding: 0; margin-bottom: 0; }
.tab-btn { padding: 12px 18px; border: 1px solid #ddd; background: #f1f1f1; cursor: pointer; font-weight: bold; color: #555; border-radius: 5px 5px 0 0; margin-right: 2px; border-bottom: none; font-size: 13px; margin-bottom: -1px; z-index: 1; }
.tab-btn.active { background: #fff; border-color: #ccc; border-bottom: 1px solid #fff; color: var(--primary); }
.contenido-tab { display: none; background: #fff; border: 1px solid #ccc; padding: 25px; border-radius: 0 0 5px 5px; min-height: 480px; }
.contenido-tab.active { display: block; }
label { font-weight: bold !important; color: var(--primary) !important; display: block; margin-bottom: 5px; font-size: 13px; }
.campoform { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; margin-bottom: 10px; box-sizing: border-box; }
.campoform:disabled { background-color: #f9f9f9; color: #999; cursor: not-allowed; }
.botonera-global { display: flex; gap: 10px; margin-top: 20px; padding: 15px; background: #f4f4f4; border: 1px solid #ddd; border-radius: 5px; align-items: center; }
.tabla-mercancia { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; margin-top: 15px; }
.tabla-mercancia th { background: #f1f1f1; padding: 10px; border-bottom: 2px solid #ccc; color: #333; }
.tabla-mercancia td { padding: 8px 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
.btn-accion { border: none; cursor: pointer; font-size: 12px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; transition: background 0.2s; color: #fff; }
.btn-edit { background-color: #3498db; }
.btn-edit:hover { background-color: #2980b9; }
.btn-delete { background-color: #e74c3c; }
.btn-delete:hover { background-color: #c0392b; }
.edit-row-form { display: none; background: #fdfdfd; }
.tab-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.info-label { color: #888; font-size: 11px; text-transform: uppercase; font-weight: bold; margin-top: 10px; display: block; }
.info-value { font-size: 14px; color: #333; margin-bottom: 5px; display: block; border-bottom: 1px solid #f1f1f1; padding-bottom: 3px; }
.info-titulo { color: var(--primary); border-bottom: 2px solid #eee; padding-bottom: 5px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.izquierda { margin-bottom: 0px; display: flex; gap: 10px; }
.izquierda a { padding: 10px 15px; border-radius: 4px 4px 0px 0px; text-decoration: none; font-weight: bold; color: #fff; background-color: #3498db; }
.izquierda a:hover { opacity: 0.9; }
.izquierda a.tab-sin-cotizar { background-color: #e74c3c; position: relative; }
.izquierda a.tab-sin-cotizar:hover, .izquierda a.tab-sin-cotizar.active { background-color: #c0392b; }
.izquierda a.tab-facturar { background-color: #3498db; position: relative; }
.izquierda a.tab-facturar.active, .izquierda a.tab-facturar:hover { background-color: #2980b9; }
.izquierda a.tab-limpiar { background-color: #95a5a6; }
.izquierda a.tab-limpiar:hover { background-color: #7f8c8d; }
.globo-contador { background-color: #2c3e50; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 10px; position: absolute; top: -8px; right: -8px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.2); z-index: 10; }
.buscadorprincipal { display: flex; justify-content: flex-end; width: 100%; margin-bottom: 20px; }
.form-buscador-flex { display: flex; width: 33.33%; min-width: 400px; gap: 10px; align-items: center; }
.swal-text-left { text-align: left; }
.swal-caja-huecos { background: #f9f9f9; padding: 15px; border-radius: 5px; border: 1px solid #eee; margin-top: 15px; }
.swal-txt-info { color: #777; display: block; margin-top: 5px; font-size: 0.85em; }
.swal-form-label { display: block; text-align: left; font-size: 13px; font-weight: bold; color: #555; margin-top: 10px; margin-bottom: 5px; }
.swal2-input-full { width: 100%; margin: 0; box-sizing: border-box; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.checkbox-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.btn-flotante { position: fixed; bottom: 30px; right: 30px; z-index: 1000; background-color: #e74c3c; color: white; border: none; padding: 15px 25px; border-radius: 50px; font-size: 16px; font-weight: bold; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.2s; display: flex; align-items: center; gap: 10px; }
.btn-flotante:hover { transform: scale(1.05); background-color: #c0392b; }
*/