/* =====================================================================
   Teknovista ERP · styles.css
   Mismos estilos del admin.html original + paginación y utilidades
   ===================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; }
:root { --azul-marino: #0B2046; --celeste: #00AEEF; --blanco: #ffffff; --fondo: #f4f6f9; --texto-oscuro: #333333; --gris-suave: #eef2f7; --excel-verde: #107c41; }
body { background-color: var(--fondo); color: var(--texto-oscuro); display: flex; height: 100vh; overflow: hidden; }

/* ---------- Toasts ---------- */
#toast-container { position: fixed; bottom: 30px; right: 30px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--azul-marino); color: white; padding: 15px 25px; border-radius: 8px; box-shadow: 0 8px 25px rgba(0,0,0,0.15); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px; opacity: 0; transform: translateY(20px); transition: all 0.3s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #ff4d4d; border-left: 5px solid #cc0000; }
.toast.success { background: #0ca678; border-left: 5px solid #087f5b; }
.toast.warning { background: #f59e0b; border-left: 5px solid #d97706; }

/* ---------- Modales ---------- */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 3000; justify-content: center; align-items: center; backdrop-filter: blur(3px); }
.modal-card { background: white; padding: 30px; border-radius: 12px; width: 90%; max-width: 700px; max-height: 90vh; overflow-y: auto; box-shadow: 0 15px 35px rgba(0,0,0,0.2); }
.modal-card.large { max-width: 850px; }
.modal-card h3 { color: var(--azul-marino); margin-bottom: 20px; font-weight: 800; font-size: 18px; border-bottom: 2px solid var(--gris-suave); padding-bottom: 10px; }

/* ---------- Formularios ---------- */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: #555; margin-bottom: 6px; text-transform: uppercase; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; transition: border-color 0.3s; text-transform: uppercase; }
.form-group input[type="email"], .form-group input[type="password"], .form-group input[type="url"], .form-group input.normal-text { text-transform: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--celeste); }

.linea-item { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; background: #f8fafc; padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; }
.linea-item input, .linea-item select { padding: 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; }
.linea-desc { flex-grow: 2; text-transform: uppercase; }
.linea-cant { width: 60px; text-align: center; }
.linea-precio { width: 100px; text-align: right; }
.linea-freq { width: 110px; font-size: 11px; background: #fff; cursor: pointer; }

/* ---------- Botones ---------- */
.btn-whatsapp { background: #25d366; color: white; padding: 6px 10px; border-radius: 6px; text-decoration: none; font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; gap: 6px; transition: background 0.3s; }
.btn-whatsapp:hover { background: #1ebe57; color: white; }
.btn-primary { background-color: var(--celeste); color: var(--blanco); padding: 10px 20px; border: none; font-weight: 700; border-radius: 8px; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: all 0.3s; width: 100%; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 174, 239, 0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-excel { background-color: var(--excel-verde); color: var(--blanco); padding: 8px 15px; border: none; font-weight: 700; border-radius: 6px; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px; font-size: 11px; }
.btn-excel:hover { background-color: #0c6132; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(16, 124, 65, 0.4); }
.btn-accion { background: var(--celeste); color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 11px; text-transform: uppercase; transition: all 0.3s; }
.btn-accion:hover { background: #0090c7; }
.btn-danger { background: #ff4d4d; color: white; border: none; padding: 6px 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.btn-danger:hover { background: #cc0000; }
.btn-secondary { background: #888; color: white; padding: 10px 20px; border: none; font-weight: 700; border-radius: 6px; cursor: pointer; text-transform: uppercase; font-size: 12px; }
.btn-pdf { background: #0ca678; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 11px; text-transform: uppercase; transition: all 0.3s; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn-pdf:hover { background: #087f5b; color: white; }
.btn-editar { background: var(--azul-marino); color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 11px; text-transform: uppercase; transition: all 0.3s; display: inline-flex; align-items: center; gap: 6px; }
.btn-editar:disabled { background: #888; cursor: not-allowed; opacity: 0.7; }

/* ---------- Filtro de fechas ---------- */
.filtro-rango { padding: 8px 35px 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-family: 'Montserrat', sans-serif; font-size: 12px; outline: none; font-weight: 600; color: var(--azul-marino); background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%230B2046" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat right 10px center; cursor: pointer; min-width: 220px; transition: border-color 0.3s; }
.filtro-rango:hover, .filtro-rango:focus { border-color: var(--celeste); }

.input-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; max-width: 180px; border: 1px solid transparent; background: transparent; font-size: 13px; color: #333; display: inline-block; padding: 8px 4px; }

/* ---------- Permisos por rol (ocultan controles en la UI; la seguridad real es RLS) ---------- */
body.no-edit-clientes .ocultar-si-no-edita-clientes { display: none !important; }
body.no-edit-proyectos .ocultar-si-no-edita-proyectos { display: none !important; }
body.no-edit-leads .ocultar-si-no-edita-leads { display: none !important; }
body.no-edit-cotizaciones .ocultar-si-no-edita-cotizaciones { display: none !important; }
body.no-edit-sistemas .ocultar-si-no-edita-sistemas { display: none !important; }
body.no-edit-core .ocultar-si-no-edita-core { display: none !important; }
body.no-edit-polizas .ocultar-si-no-edita-polizas { display: none !important; }
body.no-edit-configuracion .ocultar-si-no-edita-configuracion { display: none !important; }

body.no-delete-clientes .btn-eliminar-cliente { display: none !important; }
body.no-delete-proyectos .btn-eliminar-proyecto { display: none !important; }
body.no-delete-leads .btn-eliminar-lead { display: none !important; }
body.no-delete-cotizaciones .btn-eliminar-cotizacion { display: none !important; }
body.no-delete-sistemas .btn-eliminar-sistema { display: none !important; }
body.no-delete-polizas .btn-eliminar-poliza { display: none !important; }

/* ---------- Login ---------- */
#login-section { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; z-index: 2000; overflow: hidden; }
.login-bg { position: absolute; top: -10%; left: -10%; width: 120%; height: 120%; background: linear-gradient(135deg, rgba(11, 32, 70, 0.85) 0%, rgba(17, 45, 94, 0.95) 100%), url('https://images.unsplash.com/photo-1518770660439-4636190af475?q=80&w=2070&auto=format&fit=crop'); background-size: cover; background-position: center; z-index: -1; animation: bgMove 25s infinite alternate linear; }
@keyframes bgMove { 0% { transform: scale(1) translate(0, 0); } 100% { transform: scale(1.1) translate(-2%, -2%); } }
.login-card { background: var(--blanco); padding: 40px; border-radius: 16px; width: 100%; max-width: 400px; box-shadow: 0 15px 35px rgba(0,0,0,0.4); text-align: center; z-index: 1; }
.login-card h2 { color: var(--azul-marino); margin-bottom: 25px; font-weight: 800; font-size: 24px; }
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label { display: block; font-size: 12px; font-weight: 600; color: #666; margin-bottom: 8px; text-transform: uppercase; }
.input-group input { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; text-transform: none; }

/* ---------- Layout principal ---------- */
#dashboard-section { display: none; width: 100%; height: 100vh; }
.app-container { display: flex; width: 100%; height: 100%; }

aside { width: 260px; background: var(--azul-marino); color: var(--blanco); display: flex; flex-direction: column; justify-content: space-between; padding: 30px 20px; border-right: 1px solid rgba(255,255,255,0.05); overflow-y: auto; flex-shrink: 0; }
.sidebar-brand-area { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; padding-left: 5px; }
.sidebar-logo { height: 38px; width: auto; object-fit: contain; mix-blend-mode: screen; filter: brightness(1.2); }
.sidebar-brand-text { font-size: 18px; font-weight: 800; color: var(--blanco); }
.sidebar-brand-text span { color: var(--celeste); }
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 5px; flex-grow: 1; }
.sidebar-category { font-size: 10px; font-weight: 800; color: #5c7299; letter-spacing: 1px; padding: 15px 5px 5px; text-transform: uppercase; }
.sidebar-menu li { display: block; }
.sidebar-menu li a { display: flex; align-items: center; gap: 12px; color: #b0c4de; text-decoration: none; padding: 10px 15px; border-radius: 8px; font-weight: 600; font-size: 13px; transition: all 0.3s; cursor: pointer; }
.sidebar-menu li.active a, .sidebar-menu li a:hover { background: rgba(0, 174, 239, 0.15); color: var(--celeste); border-left: 3px solid var(--celeste); }
.btn-logout { background: transparent; color: #ff6b6b; border: 1px solid rgba(255,107,107,0.3); width: 100%; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }

.main-content { flex-grow: 1; background: var(--fondo); display: flex; flex-direction: column; overflow-y: auto; }
header { background: var(--blanco); padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eaeaea; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
header h1 { font-size: 20px; font-weight: 800; color: var(--azul-marino); }
.user-info { font-size: 13px; font-weight: 600; color: #666; display: flex; align-items: center; gap: 8px; }
.user-role-badge { background: var(--celeste); color: white; padding: 2px 8px; border-radius: 10px; font-size: 10px; margin-left: 8px; text-transform: uppercase; }

.content-body { padding: 30px 40px; }
.card { background: var(--blanco); border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); overflow: hidden; border: 1px solid #eaeaea; }
.card-header { padding: 20px 25px; border-bottom: 1px solid #eaeaea; font-weight: 800; color: var(--azul-marino); font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.view-section { display: none; animation: fadeIn 0.3s ease-in-out; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 16px 20px; font-size: 13px; border-bottom: 1px solid #f1f3f5; }
th { background-color: var(--gris-suave); color: #555; font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
tr:hover { background-color: #fafbfc; }

/* Paginación (nuevo) */
.paginacion { display: flex; justify-content: space-between; align-items: center; padding: 14px 25px; border-top: 1px solid #eaeaea; font-size: 12px; font-weight: 600; color: #666; }
.paginacion .pag-botones { display: flex; gap: 8px; }
.paginacion button { background: var(--gris-suave); color: var(--azul-marino); border: 1px solid #dbe3ee; padding: 6px 12px; border-radius: 6px; font-weight: 700; font-size: 11px; cursor: pointer; }
.paginacion button:hover:not(:disabled) { background: var(--celeste); color: white; border-color: var(--celeste); }
.paginacion button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge-pendiente { background: #fff8e1; color: #f59e0b; padding: 6px 12px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; display: inline-block; }
.badge-activo { background: #e6fcf5; color: #0ca678; padding: 6px 12px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; display: inline-block; }
.badge-inactivo { background: #fee2e2; color: #ef4444; padding: 6px 12px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; display: inline-block; }

.badge-landing { background: #e0e7ff; color: #4338ca; padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.badge-manual { background: #f3f4f6; color: #4b5563; padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.badge-organico { background: #e6fcf5; color: #0ca678; padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; display: inline-block; margin-top: 4px; }
.badge-inorganico { background: #fef3c7; color: #d97706; padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; display: inline-block; margin-top: 4px; }

.badge-estatus-proy { padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; background: #f1f5f9; color: #475569; display: inline-block; }
.badge-estatus-proy.rechazado { background: #fee2e2; color: #ef4444; }

.select-estatus, .select-segmento, .select-estatus-poliza, .select-estatus-cliente { padding: 6px 8px; border-radius: 6px; border: 1px solid #ddd; font-weight: 600; font-size: 11px; outline: none; background: #fff; cursor: pointer; width: 100%; max-width: 140px; }
.select-estatus:disabled, .select-segmento:disabled, .select-estatus-poliza:disabled, .select-estatus-cliente:disabled { background: #e9ecef; color: #6c757d; cursor: not-allowed; }

/* ---------- Dashboard ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; margin-bottom: 30px; }
.kpi-card { background: white; padding: 25px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); display: flex; align-items: center; gap: 20px; border: 1px solid #eaeaea; border-left: 5px solid var(--celeste); transition: transform 0.3s; }
.kpi-card:hover { transform: translateY(-5px); }
.kpi-card.success { border-left-color: #0ca678; }
.kpi-card.warning { border-left-color: #f59e0b; }
.kpi-card.purple { border-left-color: #8b5cf6; }
.kpi-card.mrr-card { border-left-color: #107c41; }
.kpi-icon { width: 55px; height: 55px; background: var(--fondo); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 22px; color: var(--azul-marino); flex-shrink: 0; }
.kpi-data { flex-grow: 1; }
.kpi-data h4 { font-size: 11px; color: #888; text-transform: uppercase; margin-bottom: 2px; font-weight: 700; }
.kpi-data h2 { font-size: 22px; color: var(--texto-oscuro); font-weight: 800; margin-bottom: 2px; }
.kpi-data span { font-size: 10px; color: #888; font-weight: 600; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }

.dashboard-charts { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.chart-container { height: 320px; width: 100%; position: relative; padding: 20px; }

/* ---------- Configuración ---------- */
.config-tabs { display: flex; border-bottom: 2px solid #eaeaea; margin-bottom: 25px; gap: 20px; }
.config-tab { padding: 10px 15px; cursor: pointer; font-weight: 700; color: #888; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.3s; font-size: 13px; text-transform: uppercase; }
.config-tab.active { color: var(--celeste); border-bottom-color: var(--celeste); }
.config-content { display: none; animation: fadeIn 0.3s ease-in-out; }
.config-content.active { display: block; }

.catalog-list { list-style: none; padding: 0; margin-bottom: 15px; max-height: 250px; overflow-y: auto; }
.catalog-list li { background: #f8fafc; border: 1px solid #e2e8f0; padding: 10px 15px; border-radius: 8px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: #555; }
.catalog-list li i { color: #ff4d4d; cursor: pointer; transition: transform 0.2s; }
.catalog-list li i:hover { transform: scale(1.2); }
.add-catalog-group { display: flex; gap: 10px; }
.add-catalog-group input { flex-grow: 1; padding: 10px; border: 1px solid #ddd; border-radius: 6px; outline: none; text-transform: none; }
.add-catalog-group button { padding: 10px 20px; background: var(--azul-marino); color: white; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; }

.fiscal-toggles { display: flex; gap: 20px; margin-bottom: 15px; padding: 12px; background: #f1f5f9; border-radius: 8px; border: 1px solid #cbd5e1; }
.fiscal-toggles label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--azul-marino); cursor: pointer; margin: 0; }
.fiscal-toggles input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--celeste); }

.permisos-tabla { width: 100%; border-collapse: collapse; margin-bottom: 15px; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.permisos-tabla th, .permisos-tabla td { padding: 10px 15px; text-align: center; font-size: 12px; border-bottom: 1px solid #f1f3f5; }
.permisos-tabla th { background: #f1f5f9; color: var(--azul-marino); font-weight: 700; text-transform: uppercase; }
.permisos-tabla td:first-child { text-align: left; font-weight: 600; color: #333; }
.permisos-tabla input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--celeste); }

/* ---------- Sistemas en vivo ---------- */
.sistemas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 20px; width: 100%; }
.sistema-card { background: white; border: 1px solid #eaeaea; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.3s; width: 100%; min-width: 0; }
.sistema-card:hover { transform: translateY(-4px); border-color: var(--celeste); }
.sistema-card h4 { color: var(--azul-marino); font-size: 16px; font-weight: 800; margin-bottom: 8px; word-break: break-word; }
.sistema-card .tec-badge { display: inline-block; background: #e0f7fa; color: #0090c7; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; margin-bottom: 12px; text-transform: uppercase; }
.sistema-card p { font-size: 13px; color: #555; line-height: 1.5; margin-bottom: 15px; word-break: break-word; }
.sistema-card .core-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; font-size: 11px; color: #475569; margin-bottom: 15px; max-height: 100px; overflow-y: auto; word-break: break-word; }
.sistema-card .acciones-sistema { display: flex; gap: 8px; align-items: center; border-top: 1px solid #f1f3f5; padding-top: 15px; }

/* ---------- Generador Core (chat IA) ---------- */
.chat-box { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; padding: 20px; height: 450px; overflow-y: auto; margin-bottom: 15px; display: flex; flex-direction: column; gap: 15px; position: relative; }
.chat-msg { padding: 14px 18px; border-radius: 8px; font-size: 13.5px; max-width: 92%; line-height: 1.6; white-space: pre-wrap; }
.chat-msg.ia { background: #e2e8f0; color: #0b2046; align-self: flex-start; border-left: 5px solid var(--celeste); }
.chat-msg.user { background: var(--celeste); color: white; align-self: flex-end; }

#coreLoading { text-align: center; padding: 12px; color: var(--celeste); font-weight: 700; font-size: 13px; background: rgba(0, 174, 239, 0.05); border: 1px dashed var(--celeste); border-radius: 8px; margin-top: 10px; display: none; }

/* ---------- Montos ocultos (privacidad en pantalla) ---------- */
body.montos-ocultos .kpi-data h2,
body.montos-ocultos .kpi-data span {
  filter: blur(9px); user-select: none; transition: filter .15s;
}

/* ===================== Actas de entrega ===================== */
.acta-modal { padding: 28px 30px; }
.acta-modal input, .acta-modal textarea, .acta-modal select { text-transform: none; font-family: 'Montserrat', sans-serif; }
.acta-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.acta-h { margin: 0 0 4px; border: 0 !important; padding: 0 !important; font-size: 19px !important; color: var(--azul-marino); font-weight: 800; }
.acta-tenue { color: #7a8599; font-size: 12px; }
.acta-err { color: #d6453d; font-size: 13px; }
.acta-sub { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--azul-marino); margin: 18px 0 8px; }
.acta-sub-fila { display: flex; justify-content: space-between; align-items: center; }
.acta-sub-fila span, .acta-sub-fila .acta-link { text-transform: none; letter-spacing: 0; }
.acta-chip { display: inline-block; font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 20px; letter-spacing: .03em; vertical-align: 1px; margin-left: 6px; }
.acta-ok { background: #e3f6ee; color: #0c8a5a; } .acta-wait { background: #fff4dc; color: #a66f00; } .acta-draft { background: #eef2f7; color: #64708a; }
.acta-btn { border: 1px solid #dbe3ee; background: #fff; color: var(--azul-marino); padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: .2s; }
.acta-btn:hover { border-color: var(--celeste); }
.acta-prim { background: var(--azul-marino); color: #fff; border-color: var(--azul-marino); }
.acta-prim:hover { background: #13305f; }
.acta-prim:disabled { opacity: .6; cursor: wait; }
.acta-wa { background: #25d366; color: #fff; border-color: #25d366; }
.acta-sm { padding: 6px 11px; font-size: 11px; }
.acta-ico { border: 0; background: transparent; color: #64708a; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.acta-ico:hover { background: #eef2f7; color: var(--azul-marino); }
.acta-del:hover { background: #fdecea; color: #d6453d; }
.acta-link { border: 0; background: none; color: #0090c7; font-weight: 700; font-size: 12px; cursor: pointer; padding: 0; }
.acta-lista { border: 1px solid #e8edf4; border-radius: 12px; overflow: hidden; }
.acta-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #eef2f7; }
.acta-fila:last-child { border-bottom: 0; }
.acta-fila-i > div:first-child { font-size: 14px; color: var(--azul-marino); margin-bottom: 3px; }
.acta-fila-a { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.acta-vacio { text-align: center; padding: 36px 10px; color: #64708a; }
.acta-vacio i { font-size: 34px; color: #c7d2e1; margin-bottom: 10px; }
.acta-pie { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #eef2f7; }
.acta-grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.acta-partes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.acta-campo { display: block; margin-bottom: 10px; }
.acta-campo span { display: block; font-size: 11px; color: #7a8599; font-weight: 600; margin-bottom: 4px; }
.acta-campo input, .acta-campo textarea, .acta-item input, .acta-item select {
  width: 100%; border: 1px solid #dbe3ee; border-radius: 8px; padding: 9px 11px; font-size: 13px; color: #1d2738; background: #fff; outline: none; box-sizing: border-box; }
.acta-campo input:focus, .acta-campo textarea:focus, .acta-item input:focus, .acta-item select:focus { border-color: var(--celeste); box-shadow: 0 0 0 3px rgba(0,174,239,.12); }
.acta-item { display: grid; grid-template-columns: 1fr 64px 140px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.acta-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.acta-foto { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eef2f7; }
.acta-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acta-foto-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(11,32,70,.75); color: #fff; font-size: 10px; cursor: pointer; }
.acta-resumen { border: 1px solid #e8edf4; border-radius: 12px; padding: 4px 14px; margin-bottom: 14px; }
.acta-resumen div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1f4f8; font-size: 13px; }
.acta-resumen div:last-child { border-bottom: 0; }
.acta-resumen b { color: var(--azul-marino); white-space: nowrap; font-size: 12px; }
.acta-conf { background: #f6f8fb; border-radius: 10px; padding: 12px 14px; font-size: 12px; line-height: 1.55; color: #50586a; margin-bottom: 14px; }
.acta-pad { width: 100%; height: 190px; border: 1.5px dashed #b9c6d8; border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.acta-aviso { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #e6f7fd; border-radius: 10px; padding: 12px 14px; font-size: 12px; margin-bottom: 14px; color: #0B2046; }
.acta-aviso code { font-size: 11px; word-break: break-all; color: #0b6f99; }
@media (max-width: 640px) {
  .acta-modal { padding: 20px 16px; }
  .acta-grid2, .acta-partes { grid-template-columns: 1fr; gap: 0; }
  .acta-item { grid-template-columns: 1fr 56px 32px; }
  .acta-item select { grid-column: 1 / 3; }
  .acta-fila { flex-direction: column; align-items: flex-start; }
}

/* ===================== Facturar CFDI ===================== */
.fac-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.fac-2 { grid-column: span 2; }
.fac-grid select, .fac-linea select, .fac-linea textarea { width: 100%; border: 1px solid #dbe3ee; border-radius: 8px; padding: 9px 10px; font-size: 13px; font-family: 'Montserrat', sans-serif; background: #fff; box-sizing: border-box; text-transform: none; }
.fac-linea { display: grid; grid-template-columns: 1fr 64px 110px 170px 130px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.fac-linea input { width: 100%; border: 1px solid #dbe3ee; border-radius: 8px; padding: 9px 10px; font-size: 13px; box-sizing: border-box; }
.fac-linea textarea { resize: vertical; min-height: 38px; }
.fac-cab { margin-bottom: 4px; font-size: 11px; color: #7a8599; font-weight: 600; }
.fac-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 6px 0 10px; font-size: 13px; color: #0B2046; font-weight: 600; }
.fac-checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.fac-checks input { accent-color: #00AEEF; width: 16px; height: 16px; }
.fac-totales { margin: 16px 0 0 auto; max-width: 320px; font-size: 13px; }
.fac-totales div { display: flex; justify-content: space-between; padding: 5px 0; color: #50586a; }
.fac-totales b { color: #1d2738; font-variant-numeric: tabular-nums; }
.fac-total { border-top: 2px solid #00AEEF; margin-top: 4px; padding-top: 9px !important; font-size: 16px; }
.fac-total span, .fac-total b { color: #0B2046 !important; font-weight: 800; }
@media (max-width: 760px) {
  .fac-grid { grid-template-columns: 1fr; } .fac-2 { grid-column: auto; }
  .fac-cab { display: none; }
  .fac-linea { grid-template-columns: 1fr 1fr 32px; padding-bottom: 10px; border-bottom: 1px solid #eef2f7; }
  .fac-linea .fl-desc { grid-column: 1 / -1; }
  .fac-linea .fl-clave, .fac-linea .fl-uni { grid-column: span 1; }
}


/* ===================== Celular / tablet (≤ 900 px) ===================== */
.btn-menu { display: none; background: none; border: 0; font-size: 20px; color: var(--azul-marino); cursor: pointer; padding: 6px 10px 6px 0; }
.menu-velo { display: none; }
@media (max-width: 900px) {
  #dashboard-section { height: 100dvh; }
  .app-container { display: block; height: 100%; }
  /* Menú lateral como panel deslizable */
  aside { position: fixed; top: 0; left: 0; bottom: 0; width: 82vw; max-width: 300px; height: 100dvh; z-index: 2500;
          transform: translateX(-110%); transition: transform .25s ease; padding: 22px 16px; box-shadow: none; }
  body.menu-abierto aside { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  body.menu-abierto .menu-velo { display: block; position: fixed; inset: 0; background: rgba(11,32,70,.45); z-index: 2400; }
  body.menu-abierto { overflow: hidden; }
  .sidebar-footer { position: sticky; bottom: -22px; background: var(--azul-marino); padding: 10px 0 18px; }
  .btn-menu { display: inline-flex; }
  /* Contenido */
  .main-content { height: 100dvh; overflow-y: auto; }
  header { padding: 12px 16px; gap: 10px; position: sticky; top: 0; z-index: 50; flex-wrap: nowrap; }
  header h1 { font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #btnOjoMontos { margin: 0 !important; padding: 6px 9px !important; font-size: 0 !important; }
  #btnOjoMontos i { font-size: 14px; }
  .user-info #nombre-usuario, .user-info .fa-user-circle { display: none; }
  .user-role-badge { margin-left: 0; }
  .content-body { padding: 16px; }
  /* Tablas: se desplazan de lado en vez de romper la página */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card table { min-width: 640px; }
  .card-header { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
  /* Bloques con estilos en línea tipo "flex" del dashboard */
  .view-section > div[style*="display: flex"] { flex-wrap: wrap; gap: 14px; }
  .view-section h2 { font-size: 18px !important; }
  /* Modales a pantalla casi completa */
  .modal-card { width: 96% !important; padding: 18px !important; max-height: 92dvh; }
}
